diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-02-05 11:24:15 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-02-05 11:24:15 (GMT) |
commit | 7095721d3eb563c7104c4b4a6a53aa62def29d53 (patch) | |
tree | fd520bdf3190e4ccf04cc99ac1064a0f2b21b976 /Doc/faq/library.rst | |
parent | 11480b6fe34ffdcaa377c6bdfd83f3703e1cc6a6 (diff) | |
download | cpython-7095721d3eb563c7104c4b4a6a53aa62def29d53.zip cpython-7095721d3eb563c7104c4b4a6a53aa62def29d53.tar.gz cpython-7095721d3eb563c7104c4b4a6a53aa62def29d53.tar.bz2 |
Mention asyncore and Twisted in the library FAQ.
Diffstat (limited to 'Doc/faq/library.rst')
-rw-r--r-- | Doc/faq/library.rst | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Doc/faq/library.rst b/Doc/faq/library.rst index 06a1ae6..ee099cf 100644 --- a/Doc/faq/library.rst +++ b/Doc/faq/library.rst @@ -757,7 +757,8 @@ some sample code:: How do I avoid blocking in the connect() method of a socket? ------------------------------------------------------------ -The select module is commonly used to help with asynchronous I/O on sockets. +The :mod:`select` module is commonly used to help with asynchronous I/O on +sockets. To prevent the TCP connect from blocking, you can set the socket to non-blocking mode. Then when you do the ``connect()``, you will either connect immediately @@ -771,6 +772,12 @@ just return the errno value. To poll, you can call ``connect_ex()`` again later -- ``0`` or ``errno.EISCONN`` indicate that you're connected -- or you can pass this socket to select to check if it's writable. +.. note:: + The :mod:`asyncore` module presents a framework-like approach to the problem + of writing non-blocking networking code. + The third-party `Twisted <http://twistedmatrix.com/>`_ library is + a popular and feature-rich alternative. + Databases ========= |