you forgot that message size = m_header.len + sizeof( m_header.type ) + sizeof( m_header.time ) + sizeof( m_header.len )