code: def _pack(self, msg_type, payload):
          
          pb = payload.encode('utf-8')
          s = struct.pack('=II', len(pb), msg_type.value)
          return self.MAGIC.encode('utf-8') + s + pb
docs: Packs the given message type and payload. Turns the resulting
          message into a byte string.