change 4 bytes header to uint32_t type when sending binary format