ftplib -- how to timeout a connection

Alex Martelli aleaxit at yahoo.com
Sat Apr 28 03:59:31 EDT 2001


"James Sleeman" <bitsy_boffin at cyberdude.com> wrote in message
news:9cdqf3$9pf$1 at lust.ihug.co.nz...
    [snip]
> to connect.  I want some way of specifying a connect timeout such that if
> the connection phase (including login) has not completed in n seconds
> that it should fail (throw an exception) then and there.
>
> Can anybody think of a way I can do this ?

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


Alex






More information about the Python-list mailing list