MCPcopy Index your code
hub / github.com/python-websockets/websockets / data_to_send

Method data_to_send

src/websockets/protocol.py:497–515  ·  view source on GitHub ↗

Obtain data to send to the network. Call this method immediately after any of the ``receive_*()``, ``send_*()``, or :meth:`fail` methods. Write resulting data to the connection. The empty bytestring :data:`~websockets.protocol.SEND_EOF` signals the

(self)

Source from the content-addressed store, hash-verified

495 # Public method for getting outgoing data after receiving data or sending events.
496
497 def data_to_send(self) -> list[bytes]:
498 """
499 Obtain data to send to the network.
500
501 Call this method immediately after any of the ``receive_*()``,
502 ``send_*()``, or :meth:`fail` methods.
503
504 Write resulting data to the connection.
505
506 The empty bytestring :data:`~websockets.protocol.SEND_EOF` signals
507 the end of the data stream. When you receive it, half-close the TCP
508 connection.
509
510 Returns:
511 Data to write to the connection.
512
513 """
514 writes, self.writes = self.writes, []
515 return writes
516
517 def close_expected(self) -> bool:
518 """

Calls

no outgoing calls