catch non-blocking socket exceptions

Fredrik Lundh fredrik at pythonware.com
Thu Jun 26 11:21:24 EDT 2003


Axel Bock wrote:

> or better still - does someone know how to set the tcp timeout value? THIS
> would greatly simplyfy my task :-)

for 2.3, use the "settimeout" socket method (or the setdefaulttimeout
function):

    http://www.python.org/dev/doc/devel/lib/module-socket.html
    http://www.python.org/dev/doc/devel/lib/socket-objects.html

older versions:

    http://www.timo-tasi.org/python/timeoutsocket.py

or use asyncronous sockets, and time out when you get bored waiting
for some socket action:

    http://www.effbot.org/zone/effnews-1.htm (asyncore basics)
    http://www.effbot.org/zone/effnews-3.htm (look under "managing downloads")

</F>








More information about the Python-list mailing list