Use record instead of sequence of bytes
Replace htonl with htons for 2 byte numbers
use big-endian for the header