Also, this [2]... you're skipping over something in the packet. What are you skipping over? Use sizeof() or a define for PACKET_HEADER_SIZE or something to future proof us against changes to the format.