Resolving 10060, 'Operation timed out'

Larry Bates lbates at syscononline.com
Wed Apr 20 13:57:40 EDT 2005


My manual says that socket has a settimeout(value) but I don't
seem to find anything on socket.setdefaulttimeout method you
refer to.

<snip>
settimeout( value)

Set a timeout on blocking socket operations. The value argument can be a
nonnegative float expressing seconds, or None. If a float is given, subsequent
socket operations will raise an timeout exception if the timeout period value
has elapsed before the operation has completed. Setting a timeout of None
disables timeouts on socket operations. s.settimeout(0.0) is equivalent to
s.setblocking(0); s.settimeout(None) is equivalent to s.setblocking(1). New in
version 2.3.

-Larry Bates



willitfw wrote:
> Does anyone know how to prevent this error from occurring: IOError:
> [Errno socket error] (10060, 'Operation timed out').
> 
> I am using the following code without any luck.  Obviously I am missing
> something.
> 
> import socket
> socket.setdefaulttimeout(20)
> 
> Thank you in advance.
> 
> Tom Williams
> 



More information about the Python-list mailing list