mirror of
https://github.com/python/cpython.git
synced 2025-11-11 06:39:54 +00:00
After hearing from someone who gave up on timeout sockets due to a
mistake in his code, I'm adding a note explaining that you should call settimeout() before connect().
This commit is contained in:
parent
2cbdc2a461
commit
5a92175fbc
1 changed files with 4 additions and 0 deletions
|
|
@ -625,6 +625,10 @@ method should only be used when the socket is in blocking mode; in
|
||||||
timeout or non-blocking mode file operations that cannot be completed
|
timeout or non-blocking mode file operations that cannot be completed
|
||||||
immediately will fail.
|
immediately will fail.
|
||||||
|
|
||||||
|
Note that the \method{connect()} operation is subject to the timeout
|
||||||
|
setting, and in general it is recommended to call
|
||||||
|
\method{settimeout()} before calling \method{connect()}.
|
||||||
|
|
||||||
\begin{methoddesc}[socket]{setsockopt}{level, optname, value}
|
\begin{methoddesc}[socket]{setsockopt}{level, optname, value}
|
||||||
Set the value of the given socket option (see the \UNIX{} manual page
|
Set the value of the given socket option (see the \UNIX{} manual page
|
||||||
\manpage{setsockopt}{2}). The needed symbolic constants are defined in
|
\manpage{setsockopt}{2}). The needed symbolic constants are defined in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue