Skip to content

Commit

Permalink
Small FAQ updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaugustin committed Feb 19, 2023
1 parent a525950 commit 87657de
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/faq/asyncio.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncio usage
Using asyncio
=============

.. currentmodule:: websockets
Expand Down
6 changes: 2 additions & 4 deletions docs/faq/common.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ Use :func:`~asyncio.wait_for`::

await asyncio.wait_for(websocket.recv(), timeout=10)

This technique works for most APIs, except for asynchronous context managers.
See `issue 574`_.

.. _issue 574: https://github.com/aaugustin/websockets/issues/574
This technique works for most APIs. When it doesn't, for example with
asynchronous context managers, websockets provides an ``open_timeout`` argument.

How can I pass arguments to a custom protocol subclass?
-------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/faq/misc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Instead, use the real import paths e.g.::
websockets.client.connect(...)
websockets.server.serve(...)

Why is websockets slower than another Python library in my benchmark?
.....................................................................
Why is websockets slower than another library in my benchmark?
..............................................................

Not all libraries are as feature-complete as websockets. For a fair benchmark,
you should disable features that the other library doesn't provide. Typically,
Expand Down
4 changes: 2 additions & 2 deletions docs/faq/server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Add error handling according to the behavior you want if the user disconnected
before the message could be sent.

This example supports only one connection per user. To support concurrent
connects by the same user, you can change ``CONNECTIONS`` to store a set of
connections by the same user, you can change ``CONNECTIONS`` to store a set of
connections for each user.

If you're running multiple server processes, call ``message_user`` in each
Expand Down Expand Up @@ -213,7 +213,7 @@ client, as shown in the :doc:`tutorial <../intro/tutorial2>`. When you want to
authenticate the connection before routing it, this is usually more convenient.

Generally speaking, there is far less emphasis on the request path in WebSocket
servers than in HTTP servers. When a WebSockt server provides a single endpoint,
servers than in HTTP servers. When a WebSocket server provides a single endpoint,
it may ignore the request path entirely.

How do I access HTTP headers?
Expand Down

0 comments on commit 87657de

Please sign in to comment.