summaryrefslogtreecommitdiffstats
path: root/Doc/library/socket.rst
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2009-02-19 01:25:51 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2009-02-19 01:25:51 (GMT)
commit349c595ff9ff3207b5cca1e314ea8fd9e3cf3cb1 (patch)
tree0fd596dc09a9ea6af8983c3e55ac494ba51e0e53 /Doc/library/socket.rst
parentcf984cee934dd5375596ca980fee45e1d943b9ef (diff)
downloadcpython-349c595ff9ff3207b5cca1e314ea8fd9e3cf3cb1.zip
cpython-349c595ff9ff3207b5cca1e314ea8fd9e3cf3cb1.tar.gz
cpython-349c595ff9ff3207b5cca1e314ea8fd9e3cf3cb1.tar.bz2
merge socket module documentation update from trunk r69731.
Diffstat (limited to 'Doc/library/socket.rst')
-rw-r--r--Doc/library/socket.rst11
1 files changed, 7 insertions, 4 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index f399dae..df80d44 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -673,12 +673,13 @@ correspond to Unix system calls applicable to sockets.
Some notes on socket blocking and timeouts: A socket object can be in one of
three modes: blocking, non-blocking, or timeout. Sockets are always created in
-blocking mode. In blocking mode, operations block until complete. In
+blocking mode. In blocking mode, operations block until complete or
+the system returns an error (such as connection timed out). In
non-blocking mode, operations fail (with an error that is unfortunately
system-dependent) if they cannot be completed immediately. In timeout mode,
operations fail if they cannot be completed within the timeout specified for the
-socket. The :meth:`setblocking` method is simply a shorthand for certain
-:meth:`settimeout` calls.
+socket or if the system returns an error. The :meth:`setblocking` method is simply
+a shorthand for certain :meth:`settimeout` calls.
Timeout mode internally sets the socket in non-blocking mode. The blocking and
timeout modes are shared between file descriptors and socket objects that refer
@@ -689,7 +690,9 @@ completed immediately will fail.
Note that the :meth:`connect` operation is subject to the timeout setting, and
in general it is recommended to call :meth:`settimeout` before calling
-:meth:`connect`.
+:meth:`connect` or pass a timeout parameter to :meth:`create_connection`.
+The system network stack may return a connection timeout error
+of its own regardless of any python socket timeout setting.
.. method:: socket.setsockopt(level, optname, value)