urllib.urlopen: how to check the time of connection?

Aahz Maruch aahz at panix.com
Sun Sep 17 11:38:52 EDT 2000


In article <ABhKfmveHT at plet.ls.ac.ru>,
Igor V. Pletnev <plet at plet.ls.ac.ru> wrote:
>
>could somebody advise on any [platform independent] idiom/hint to monitor the
>time of [http] connection by urllib.urlopen? It often appears too lengthy,
>and I would like to check/break out at some upper limit.

If it's checking you want, you'll have to rewrite urllib yourself.  If
you simply want to time out the socket if there's no activity for a
certain period of time, look at timeoutsocket.py:

http://www.timo-tasi.org/python/timeoutsocket.py
-- 
                      --- Aahz (Copyright 2000 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

The best way to get information on Usenet is not to ask a question, but 
to post the wrong information.  --Aahz



More information about the Python-list mailing list