setsockopt and urllib

Frank Neuber frank.neuber at gmx.de
Wed Dec 6 14:44:30 EST 2000


In article <3A2DD408.D4E0B8E3 at pehr.net>, pehr anderson wrote:

Hi all,
thanks for this link below ...
>http://www.timo-tasi.org/python/
This is exactly what i want :-)

I only did a little change or add in the Timeout(Exception) class to provide 
an easily access to the timeout message.

class Timeout(Exception):
   def __init__(self, message):
     self.message=message

I think this was necessary for me to use and reuse the message text in 
an error popup window.

>> Hi group,
>> I have to set special timeouts on receive and send calls in conjunction with
>> urllib-calls.
>> Is there a simple solution to do this without modifying the urllib itself.
>> For Example:
>> I wish to set the timeout to 60 s for the following command:
>> (tmpfile, hdr) = urllib.urlretrive(urlname)
>> It is possible to to this with the socks module call
>> setsockopt(SOL_SOCKET,SO_RCVTIMEO, ttime) over the urllib module.

-- 
     _/_/_/_/ _//   _/ Frank Neuber
    _/       _/_/  _/  frank.neuber at gmx.de (private)
   _/_/_/   _/ _/ _/
  _/       _/  _/_/    neuber at opensource-systemberatung.de
 _/       _/    // http://www.opensource-systemberatung.de



More information about the Python-list mailing list