Debian Codegraph @

testing/web-platform/tests/tools/third_party/websockets/docs/reference/sync/client.rst

raw
1 Client (:mod:`threading`)
2 =========================
3
4 .. automodule:: websockets.sync.client
5
6 Opening a connection
7 --------------------
8
9 .. autofunction:: connect(uri, *, sock=None, ssl_context=None, server_hostname=None, origin=None, extensions=None, subprotocols=None, additional_headers=None, user_agent_header="Python/x.y.z websockets/X.Y", compression="deflate", open_timeout=10, close_timeout=10, max_size=2 ** 20, logger=None, create_connection=None)
10
11 .. autofunction:: unix_connect(path, uri=None, *, sock=None, ssl_context=None, server_hostname=None, origin=None, extensions=None, subprotocols=None, additional_headers=None, user_agent_header="Python/x.y.z websockets/X.Y", compression="deflate", open_timeout=10, close_timeout=10, max_size=2 ** 20, logger=None, create_connection=None)
12
13 Using a connection
14 ------------------
15
16 .. autoclass:: ClientConnection
17
18 .. automethod:: __iter__
19
20 .. automethod:: recv
21
22 .. automethod:: recv_streaming
23
24 .. automethod:: send
25
26 .. automethod:: close
27
28 .. automethod:: ping
29
30 .. automethod:: pong
31
32 WebSocket connection objects also provide these attributes:
33
34 .. autoattribute:: id
35
36 .. autoattribute:: logger
37
38 .. autoproperty:: local_address
39
40 .. autoproperty:: remote_address
41
42 The following attributes are available after the opening handshake,
43 once the WebSocket connection is open:
44
45 .. autoattribute:: request
46
47 .. autoattribute:: response
48
49 .. autoproperty:: subprotocol