code: def prep_message(msg):
      
      if six.PY3:
          msg_out = msg.as_string().encode("utf-8")
      else:
          msg_out = msg.as_string()
  
      our_len = len(msg_out) + 4
      size = struct.pack('>L', our_len)
      # why the hell is this "bytes" on python3?
  
      return size + msg_out
docs: Add the size header