Resolving 10060, 'Operation timed out'

Peter Hansen peter at engcorp.com
Fri Apr 22 10:19:15 EDT 2005


willitfw wrote:
> I'm including the code that I've been using.  I am relatively new to
> python, and not sure if a socket was created:
> 
> *****************
> import socket
> 
> socket.setdefaulttimeout(None)
> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

The last line above creates a socket... and I suspect
the line ahead of it is redundant.

More importantly, you can probably avoid using
the defaulttimeout thing if you just do settimeout
on the newly created socket...



More information about the Python-list mailing list