sources/network/udpsocket.cpp

branch
protocol5
changeset 153
82aac80a2f1d
parent 150
37db42ad451a
parent 152
6be21be4bea1
child 159
970d58a01e8b
equal deleted inserted replaced
151:267ef11bd3ba 153:82aac80a2f1d
135 return false; 135 return false;
136 } 136 }
137 137
138 unsigned char decodedPacket[MAX_DATAGRAM_LENGTH]; 138 unsigned char decodedPacket[MAX_DATAGRAM_LENGTH];
139 int decodedLength = sizeof decodedPacket; 139 int decodedLength = sizeof decodedPacket;
140 HUFFMAN_Decode (reinterpret_cast<unsigned char*>(HuffmanBuffer), decodedPacket, length, &decodedLength); 140 HUFFMAN_Decode (reinterpret_cast<unsigned char*> (HuffmanBuffer),
141 datagram.from.host = ntohl (claddr.sin_addr.s_addr); 141 decodedPacket, length, &decodedLength);
142 datagram.from.port = ntohs (claddr.sin_port); 142 datagram.address.host = ntohl (claddr.sin_addr.s_addr);
143 datagram.data = Bytestream (decodedPacket, decodedLength); 143 datagram.address.port = ntohs (claddr.sin_port);
144 datagram.message = Bytestream (decodedPacket, decodedLength);
144 return true; 145 return true;
145 } 146 }
146 147
147 // ------------------------------------------------------------------------------------------------- 148 // -------------------------------------------------------------------------------------------------
148 // 149 //

mercurial