r0g <aioe....@technicalbloke.com> wrote: > It seems gethostbyname asks the OS to resolve the address and the OS > uses it's own timeout value ( 25 seconds ) rather than the one provided > in setdefaulttimeout. 25 seconds of blocking is way too long for me, I > want the response within 5 seconds or not at all but I can see no > reasonable way to do this without messing with the OS which naturally I > am loathe to do!
use signal.alarm(time) to send SIGALRM to your process: http://docs.python.org/library/signal.html#signal.alarm See example at bottom. John -- http://mail.python.org/mailman/listinfo/python-list