Socket timeouts for HTTP connections (httplib)?

nick nick_bower at yahoo.com.au
Wed Apr 2 08:50:44 EST 2003


I'm using httplib in a threaded HTTP load imparting test suite for our
portal.  A problem is that HTTP GETs often hang, blocking my
requesting threads.  I was highly disapointed to find, after writing
my test suite, that no high-level HTTP timeout functionality exists in
Python.

I have neither an expert understanding of socket programming,
threading or asyncronous IO, yet can get by using threading.Thread and
httplib.  I am therefore looking for a timeout at a fairly high level
(ie the httplib api).

There were rumblings about Guido implementing this at a socket level
in June 2002, but I've not been able to find anything since. 
Presumably this has not yet risen up into httplib either because the
python.org documentation doesn't mention it.

Has/is someone involved with this?  timeoutsocket simply doesn't work
for me and throws continuous "connection reset by peer" exceptions. 
So I'm completely stuck for options.

Thanks, Nick




More information about the Python-list mailing list