Skip to content

Commit ea25026

Browse files
committed
fix documentation of WebSocketServer handler parameter
The handler callback takes a WebSocketRequest, not WebSocketConnection.
1 parent 2477ae6 commit ea25026

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

trio_websocket/_impl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ async def _reader_task(self):
12441244

12451245
async def _send(self, event):
12461246
'''
1247-
Send an to the remote WebSocket.
1247+
Send an event to the remote WebSocket.
12481248
12491249
The reader task and one or more writers might try to send messages at
12501250
the same time, so this method uses an internal lock to serialize
@@ -1311,8 +1311,8 @@ def __init__(self, handler, listeners, *, handler_nursery=None,
13111311
multiple listeners that have _different port numbers!_ See the
13121312
``listeners`` property.
13131313
1314-
:param handler: the async function called with the corresponding
1315-
WebSocketConnection on each new connection. The call will be made
1314+
:param handler: the async function called with a :class:`WebSocketRequest`
1315+
on each new connection. The call will be made
13161316
once the HTTP handshake completes, which notably implies that the
13171317
connection's `path` property will be valid.
13181318
:param listeners: The WebSocket will be served on each of the listeners.

0 commit comments

Comments
 (0)