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 // |