setsockopt and urllib

pehr anderson pehr at pehr.net
Wed Dec 6 00:52:07 EST 2000


Dear Frank, 

Timo has written an modification to sockets that 
adds user-controlled timeouts. This should meet
your needs.  You just import the module and, well
read the documentation in timeoutsocket.py

Timo is usually happy to provide help and feedback
on the use of his code. 
His email address is also int he source file.

	-pehr

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



Frank Neuber wrote:
> 
> 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.
> 
> thanks in advance
> Frank
> 
> --
>      _/_/_/_/ _//   _/ 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