[Tutor] website information

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Mon Apr 18 20:20:08 CEST 2005



On Mon, 18 Apr 2005, Williams, Thomas wrote:

> Does anyone know how to prevent this error from occurring: IOError:
> [Errno socket error] (10060, 'Operation timed out').

Hi Tom,

You can adjust the amount of time that sockets will wait, by using
socket.setdefaulttimeout():

    http://www.python.org/doc/lib/module-socket.html#l2h-2615

The documentation there shows how to make sockets never time out.  That
being said, if an operation takes too long, you may want to catch that.


Best of wishes to you!



More information about the Tutor mailing list