def send(self, event):<EOL>
data = b"<STR_LIT>"<EOL>if isinstance(event, Request):<EOL><INDENT>data += self._initiate_connection(event)<EOL><DEDENT>elif isinstance(event, AcceptConnection):<EOL><INDENT>data += self._accept(event)<EOL><DEDENT>elif isinstance(event, RejectConnection):<EOL><INDENT>data += self._reject(event)<EOL><DEDENT>elif isinstance(event, RejectData):<EOL><INDENT>data += self._send_reject_data(event)<EOL><DEDENT>else:<EOL><INDENT>raise LocalProtocolError(<EOL>"<STR_LIT>".format(event)<EOL>)<EOL><DEDENT>return data<EOL>
Send an event to the remote.

        This will return the bytes to send based on the event or raise
        a LocalProtocolError if the event is not valid given the
        state.