Client (:mod:`threading`) ========================= .. automodule:: websockets.sync.client Opening a connection -------------------- .. autofunction:: connect .. autofunction:: reconnect .. autofunction:: unix_connect .. autofunction:: unix_reconnect Using a connection ------------------ .. autoclass:: ClientConnection .. automethod:: __iter__ .. automethod:: recv .. automethod:: recv_streaming .. automethod:: send .. automethod:: close .. automethod:: ping .. automethod:: pong WebSocket connection objects also provide these attributes: .. autoattribute:: id .. autoattribute:: logger .. autoproperty:: local_address .. autoproperty:: remote_address .. autoattribute:: latency .. autoproperty:: state The following attributes are available after the opening handshake, once the WebSocket connection is open: .. autoattribute:: request .. autoattribute:: response .. autoproperty:: subprotocol The following attributes are available after the closing handshake, once the WebSocket connection is closed: .. autoproperty:: close_code .. autoproperty:: close_reason