March 2003
Intermediate to advanced
656 pages
39h 30m
English
setDefaultSocketTimeout
setDefaultSocketTimeout(s)Sets the default timeout value, used for newly created instances of
class TimeoutSocket, to
s seconds. s is
a float or None.
Socket methods that may block and wait forever when you call them on
normal sockets, such as connect,
accept, recv, and
send, may time out when you call them on an
instance t of
TimeoutSocket with a timeout value
s that is not None. If
s seconds elapse after the call, and the
wait is still going on, then t stops
waiting and raises
timeoutsocket.Timeout.
Read now
Unlock full access