| 1 |
Server (`Sans-I/O`_) |
| 2 |
==================== |
| 3 |
|
| 4 |
.. _Sans-I/O: https://sans-io.readthedocs.io/ |
| 5 |
|
| 6 |
.. currentmodule:: websockets.server |
| 7 |
|
| 8 |
.. autoclass:: ServerProtocol |
| 9 |
|
| 10 |
.. automethod:: receive_data |
| 11 |
|
| 12 |
.. automethod:: receive_eof |
| 13 |
|
| 14 |
.. automethod:: accept |
| 15 |
|
| 16 |
.. automethod:: select_subprotocol |
| 17 |
|
| 18 |
.. automethod:: reject |
| 19 |
|
| 20 |
.. automethod:: send_response |
| 21 |
|
| 22 |
.. automethod:: send_continuation |
| 23 |
|
| 24 |
.. automethod:: send_text |
| 25 |
|
| 26 |
.. automethod:: send_binary |
| 27 |
|
| 28 |
.. automethod:: send_close |
| 29 |
|
| 30 |
.. automethod:: send_ping |
| 31 |
|
| 32 |
.. automethod:: send_pong |
| 33 |
|
| 34 |
.. automethod:: fail |
| 35 |
|
| 36 |
.. automethod:: events_received |
| 37 |
|
| 38 |
.. automethod:: data_to_send |
| 39 |
|
| 40 |
.. automethod:: close_expected |
| 41 |
|
| 42 |
WebSocket protocol objects also provide these attributes: |
| 43 |
|
| 44 |
.. autoattribute:: id |
| 45 |
|
| 46 |
.. autoattribute:: logger |
| 47 |
|
| 48 |
.. autoproperty:: state |
| 49 |
|
| 50 |
The following attributes are available after the opening handshake, |
| 51 |
once the WebSocket connection is open: |
| 52 |
|
| 53 |
.. autoattribute:: handshake_exc |
| 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 |
| 61 |
|
| 62 |
.. autoproperty:: close_exc |