File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -371,3 +371,29 @@ buffer now.
371
371
372
372
The ``write_limit `` argument of :func: `~asyncio.client.connect ` and
373
373
:func: `~asyncio.server.serve ` defaults to 32 KiB instead of 64 KiB.
374
+
375
+ Attributes of connections
376
+ .........................
377
+
378
+ ``open `` and ``closed ``
379
+ ~~~~~~~~~~~~~~~~~~~~~~~
380
+
381
+ The :attr: `~legacy.protocol.WebSocketCommonProtocol.open ` and
382
+ :attr: `~legacy.protocol.WebSocketCommonProtocol.closed ` properties are removed.
383
+ Using them was discouraged.
384
+
385
+ Instead, you should call :meth: `~asyncio.connection.Connection.recv ` or
386
+ :meth: `~asyncio.connection.Connection.send ` and handle
387
+ :exc: `~exceptions.ConnectionClosed ` exceptions.
388
+
389
+ If your code relies on them, you can replace::
390
+
391
+ connection.open
392
+ connection.closed
393
+
394
+ with::
395
+
396
+ from websockets.protocol import State
397
+
398
+ connection.state is State.OPEN
399
+ connection.state is State.CLOSED
You can’t perform that action at this time.
0 commit comments