Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
349c595f
Commit
349c595f
authored
Feb 19, 2009
by
Gregory P. Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge socket module documentation update from trunk r69731.
parent
cf984cee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
Doc/library/socket.rst
Doc/library/socket.rst
+7
-4
No files found.
Doc/library/socket.rst
View file @
349c595f
...
@@ -673,12 +673,13 @@ correspond to Unix system calls applicable to sockets.
...
@@ -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
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
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
non-blocking mode, operations fail (with an error that is unfortunately
system-dependent) if they cannot be completed immediately. In timeout mode,
system-dependent) if they cannot be completed immediately. In timeout mode,
operations fail if they cannot be completed within the timeout specified for the
operations fail if they cannot be completed within the timeout specified for the
socket
. The :meth:`setblocking` method is simply a shorthand for certain
socket
or if the system returns an error. The :meth:`setblocking` method is simply
:meth:`settimeout` calls.
a shorthand for certain
:meth:`settimeout` calls.
Timeout mode internally sets the socket in non-blocking mode. The blocking and
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
timeout modes are shared between file descriptors and socket objects that refer
...
@@ -689,7 +690,9 @@ completed immediately will fail.
...
@@ -689,7 +690,9 @@ completed immediately will fail.
Note that the :meth:`connect` operation is subject to the timeout setting, and
Note that the :meth:`connect` operation is subject to the timeout setting, and
in general it is recommended to call :meth:`settimeout` before calling
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)
.. method:: socket.setsockopt(level, optname, value)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment