def send_message(self, message):
    'Send a P2P message over the socket.\n\n        This method takes a P2P payload, builds the P2P header and adds\n        the message to the send buffer to be sent over the socket.'
    if (not self.is_connected):
        raise IOError('Not connected')
    self._log_message('send', message)
    tmsg = self._build_message(message)

    def maybe_write():
        if (not self._transport):
            return
        if (hasattr(self._transport, 'is_closing') and self._transport.is_closing()):
            return
        self._transport.write(tmsg)
    NetworkThread.network_event_loop.call_soon_threadsafe(maybe_write)
Send a P2P message over the socket.

This method takes a P2P payload, builds the P2P header and adds
the message to the send buffer to be sent over the socket.
def send_message(self, message):
    'Send a P2P message over the socket.\n\n        This method takes a P2P payload, builds the P2P header and adds\n        the message to the send buffer to be sent over the socket.'
    if (not self.is_connected):
        raise IOError('Not connected')
    self._log_message('send', message)
    tmsg = self._build_message(message)

    def maybe_write():
        if (not self._transport):
            return
        if (hasattr(self._transport, 'is_closing') and self._transport.is_closing()):
            return
        self._transport.write(tmsg)
    NetworkThread.network_event_loop.call_soon_threadsafe(maybe_write)