| 1 |
:orphan: |
| 2 |
|
| 3 |
Both sides (legacy) |
| 4 |
=================== |
| 5 |
|
| 6 |
.. admonition:: The legacy :mod:`asyncio` implementation is deprecated. |
| 7 |
:class: caution |
| 8 |
|
| 9 |
The :doc:`upgrade guide <../../howto/upgrade>` provides complete instructions |
| 10 |
to migrate your application. |
| 11 |
|
| 12 |
.. automodule:: websockets.legacy.protocol |
| 13 |
|
| 14 |
.. autoclass:: WebSocketCommonProtocol(*, logger=None, ping_interval=20, ping_timeout=20, close_timeout=10, max_size=2 ** 20, max_queue=2 ** 5, read_limit=2 ** 16, write_limit=2 ** 16) |
| 15 |
|
| 16 |
.. automethod:: recv |
| 17 |
|
| 18 |
.. automethod:: send |
| 19 |
|
| 20 |
.. automethod:: close |
| 21 |
|
| 22 |
.. automethod:: wait_closed |
| 23 |
|
| 24 |
.. automethod:: ping |
| 25 |
|
| 26 |
.. automethod:: pong |
| 27 |
|
| 28 |
WebSocket connection objects also provide these attributes: |
| 29 |
|
| 30 |
.. autoattribute:: id |
| 31 |
|
| 32 |
.. autoattribute:: logger |
| 33 |
|
| 34 |
.. autoproperty:: local_address |
| 35 |
|
| 36 |
.. autoproperty:: remote_address |
| 37 |
|
| 38 |
.. autoproperty:: open |
| 39 |
|
| 40 |
.. autoproperty:: closed |
| 41 |
|
| 42 |
.. autoattribute:: latency |
| 43 |
|
| 44 |
The following attributes are available after the opening handshake, |
| 45 |
once the WebSocket connection is open: |
| 46 |
|
| 47 |
.. autoattribute:: path |
| 48 |
|
| 49 |
.. autoattribute:: request_headers |
| 50 |
|
| 51 |
.. autoattribute:: response_headers |
| 52 |
|
| 53 |
.. autoattribute:: subprotocol |
| 54 |
|
| 55 |
The following attributes are available after the closing handshake, |
| 56 |
once the WebSocket connection is closed: |
| 57 |
|
| 58 |
.. autoproperty:: close_code |
| 59 |
|
| 60 |
.. autoproperty:: close_reason |