This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author AlexWaygood
Recipients AlexWaygood, docs@python, giampaolo.rodola, neologix
Date 2021-11-11.17:56:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1636653394.87.0.117733096007.issue45787@roundup.psfhosted.org>
In-reply-to
Content
The HOWTO for socket programming in Python (https://docs.python.org/3/howto/sockets.html#non-blocking sockets) includes the following lines (using triple-quotes here to indicate multiline quotes from the docs):

"""
The major mechanical difference [between blocking and non-blocking sockets] is that [for non-blocking sockets] send, recv, connect and accept can return without having done anything. You have (of course) a number of choices. You can check return code and error codes and generally drive yourself crazy. If you don’t believe me, try it sometime. Your app will grow large, buggy and suck CPU. So let’s skip the brain-dead solutions and do it right.

Use select.
"""

However, if you go to the documentation for the select module (https://docs.python.org/3/library/select html), it pointedly tells you at the top *not* to do exactly what the socket HOWTO tells you to do:

"""
Note The selectors module allows high-level and efficient I/O multiplexing, built upon the select module primitives. Users are encouraged to use the selectors module instead, unless they want precise control over the OS-level primitives used.
"""
History
Date User Action Args
2021-11-11 17:56:34AlexWaygoodsetrecipients: + AlexWaygood, giampaolo.rodola, neologix, docs@python
2021-11-11 17:56:34AlexWaygoodsetmessageid: <1636653394.87.0.117733096007.issue45787@roundup.psfhosted.org>
2021-11-11 17:56:34AlexWaygoodlinkissue45787 messages
2021-11-11 17:56:34AlexWaygoodcreate