Debian Codegraph @

docs/reference/trio/client.rst

raw
1 Client (:mod:`trio`)
2 =======================
3
4 .. admonition:: The :mod:`trio` API is experimental.
5 :class: caution
6
7 Please provide feedback in GitHub issues about the API, especially if you
8 can propose a more intuitive or convenient way to connect to a server.
9
10 .. automodule:: websockets.trio.client
11
12 Opening a connection
13 --------------------
14
15 .. autofunction:: connect
16
17 .. autofunction:: unix_connect
18
19 Using a connection
20 ------------------
21
22 .. autoclass:: ClientConnection
23
24 .. automethod:: __aiter__
25
26 .. automethod:: recv
27
28 .. automethod:: recv_streaming
29
30 .. automethod:: send
31
32 .. automethod:: aclose
33
34 .. automethod:: wait_closed
35
36 .. automethod:: ping
37
38 .. automethod:: pong
39
40 WebSocket connection objects also provide these attributes:
41
42 .. autoattribute:: id
43
44 .. autoattribute:: logger
45
46 .. autoproperty:: local_address
47
48 .. autoproperty:: remote_address
49
50 .. autoattribute:: latency
51
52 .. autoproperty:: state
53
54 The following attributes are available after the opening handshake,
55 once the WebSocket connection is open:
56
57 .. autoattribute:: request
58
59 .. autoattribute:: response
60
61 .. autoproperty:: subprotocol
62
63 The following attributes are available after the closing handshake,
64 once the WebSocket connection is closed:
65
66 .. autoproperty:: close_code
67
68 .. autoproperty:: close_reason