Threads, signals and sockets (on UNIX)

Stefan Behnel stefan.behnel-n05pAM at web.de
Mon Jun 11 07:20:22 EDT 2007


geoffbache wrote:
> I have a Python program (on UNIX) whose main job is to listen on a
> socket, for which I use the SocketServer module. However, I would also
> like it to be sensitive to signals received, which it isn't if it's
> listening on the socket. ("signals can only be received between atomic
> actions of the python interpreter", presumably - and control will not
> return to Python unless something appears on the socket). Does anyone
> have a tip of a good way to do this?

Twisted *should* be able to do this, as it uses non-blocking IO.

http://twistedmatrix.com/trac/

Stefan



More information about the Python-list mailing list