threading and timeouts

Piers Lauder piers at cs.su.oz.au
Sun Nov 28 23:50:52 EST 1999


The responses to my request on how to timeout threads yielded one very
useful module from Phil Mayes :-

	timeout_socket.py

This module defines a `timeout_socket' class for connections that can
potentially cause a server to hang.   By sub-classing and inheriting
from standard modules like smtplib, one can override the socket code
and use the original module without modification. See the examples
provided in the __doc__ string for more details.


With Phil's encouragement, I've modified it slightly so that it works on UN*X
systems, and have submitted it to the Vaults of Parnassus.

You can access it directly here:

	http://www.cs.su.oz.au/~piers/python/timeout_socket.py

Thanks Phil!








More information about the Python-list mailing list