MCPcopy Create free account
hub / github.com/python-websockets/websockets / receive_data

Method receive_data

src/websockets/protocol.py:257–271  ·  view source on GitHub ↗

Receive data from the network. After calling this method: - You must call :meth:`data_to_send` and send this data to the network. - You should call :meth:`events_received` and process resulting events. Raises: EOFError: If :meth:`receive_eof` w

(self, data: bytes | bytearray)

Source from the content-addressed store, hash-verified

255 # Public methods for receiving data.
256
257 def receive_data(self, data: bytes | bytearray) -> None:
258 """
259 Receive data from the network.
260
261 After calling this method:
262
263 - You must call :meth:`data_to_send` and send this data to the network.
264 - You should call :meth:`events_received` and process resulting events.
265
266 Raises:
267 EOFError: If :meth:`receive_eof` was called earlier.
268
269 """
270 self.reader.feed_data(data)
271 next(self.parser)
272
273 def receive_eof(self) -> None:
274 """

Calls 1

feed_dataMethod · 0.45