sources/network/udpsocket.cpp

changeset 152
6be21be4bea1
parent 145
d0aedc9be448
child 153
82aac80a2f1d
child 157
42bb29924218
equal deleted inserted replaced
149:7643c21d546b 152:6be21be4bea1
131 131
132 unsigned char decodedPacket[MAX_DATAGRAM_LENGTH]; 132 unsigned char decodedPacket[MAX_DATAGRAM_LENGTH];
133 int decodedLength = sizeof decodedPacket; 133 int decodedLength = sizeof decodedPacket;
134 HUFFMAN_Decode (reinterpret_cast<unsigned char*> (HuffmanBuffer), 134 HUFFMAN_Decode (reinterpret_cast<unsigned char*> (HuffmanBuffer),
135 decodedPacket, length, &decodedLength); 135 decodedPacket, length, &decodedLength);
136 datagram.from.host = ntohl (claddr.sin_addr.s_addr); 136 datagram.address.host = ntohl (claddr.sin_addr.s_addr);
137 datagram.from.port = ntohs (claddr.sin_port); 137 datagram.address.port = ntohs (claddr.sin_port);
138 datagram.data = Bytestream (decodedPacket, decodedLength); 138 datagram.message = Bytestream (decodedPacket, decodedLength);
139 return true; 139 return true;
140 } 140 }
141 141
142 // ------------------------------------------------------------------------------------------------- 142 // -------------------------------------------------------------------------------------------------
143 // 143 //

mercurial