write message length & message content together