IO timeout in threaded application

Aahz aahz at pythoncraft.com
Mon Aug 11 18:46:36 EDT 2003


In article <mailman.1060629439.21285.python-list at python.org>,
Gordon Messmer  <gmessmer at real.com> wrote:
>
>What's the easiest way to accomplish that?  Should I just subclass 
>smtplib's SMTP class and override the "connect" function with one that 
>creates a socket with a timeout?

If you don't mind having the same timeout for every socket, use either
timeoutsocket.py (or the new functionality in Python 2.3) to set a
global timeout.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

This is Python.  We don't care much about theory, except where it intersects 
with useful practice.  --Aahz




More information about the Python-list mailing list