def receive_data(self, data):<EOL>
if data is None:<EOL><INDENT>self._events.append(CloseConnection(code=CloseReason.ABNORMAL_CLOSURE))<EOL>self._state = ConnectionState.CLOSED<EOL>return<EOL><DEDENT>if self.state in (ConnectionState.OPEN, ConnectionState.LOCAL_CLOSING):<EOL><INDENT>self._proto.receive_bytes(data)<EOL><DEDENT>elif self.state is ConnectionState.CLOSED:<EOL><INDENT>raise LocalProtocolError("<STR_LIT>")<EOL><DEDENT>
Pass some received data to the connection for handling.

A list of events that the remote peer triggered by sending this data can
be retrieved with :meth:`~wsproto.connection.Connection.events`.

:param data: The data received from the remote peer on the network.
:type data: ``bytes``