On 7/4/06, Facundo Batista <[EMAIL PROTECTED]> wrote:
> 2006/7/3, Guido van Rossum <[EMAIL PROTECTED]>:
>
> > To fake things like this, socket.setdefaulttimeout() was added, though
> > I don't know if it actually works. Have you tried that?
>
> This affect all the sockets.

So, assuming your app is single-threaded, set the timeout, call
urlopen(), and reset the timeout to None.

> And I hit the problem when servicing
> information with a web service (TCPServer), and I need to timeout the
> connection of the URLOpen *only*.

That's not so easy even if you were to have a timeout parameter to
urlopen(). You'd have to implement that peculiarity in all the layers
(in this case, urllib and httplib; and possibly ftplib, gopherlib etc.
:-)

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to