code: def recv_msg(sock):
      
      data = recv(sock, struct.calcsize(METHOD_STRUCT_FORMAT))
      method, = struct.unpack(METHOD_STRUCT_FORMAT, data)
      data = recv(sock, struct.calcsize(SIZE_STRUCT_FORMAT))
      size, = struct.unpack(SIZE_STRUCT_FORMAT, data)
      data = recv(sock, size)
      msg = pickle.loads(data)
      return method, msg
docs: Receives a method and message from the socket.  This function blocks the
      current thread.