Threads, signals and sockets (on UNIX)

2007-06-11 Thread geoffbache
Hi all, 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

Re: Threads, signals and sockets (on UNIX)

2007-06-11 Thread Stefan Behnel
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

Re: Threads, signals and sockets (on UNIX)

2007-06-11 Thread geoffbache
Twisted *should* be able to do this, as it uses non-blocking IO. http://twistedmatrix.com/trac/ Thanks for the tip. I'll take a look if nobody has any better suggestions. It still seems to me that what I'm trying to do is essentially quite simple, and shouldn't require as large a tool as

Re: Threads, signals and sockets (on UNIX)

2007-06-11 Thread Jean-Paul Calderone
On Mon, 11 Jun 2007 04:56:43 -0700, geoffbache [EMAIL PROTECTED] wrote: Twisted *should* be able to do this, as it uses non-blocking IO. http://twistedmatrix.com/trac/ Thanks for the tip. I'll take a look if nobody has any better suggestions. Twisted is a pretty good suggestion in general.

Re: Threads, signals and sockets (on UNIX)

2007-06-11 Thread Chaz Ginger
geoffbache wrote: Twisted *should* be able to do this, as it uses non-blocking IO. http://twistedmatrix.com/trac/ Thanks for the tip. I'll take a look if nobody has any better suggestions. It still seems to me that what I'm trying to do is essentially quite simple, and shouldn't require

Re: Threads, signals and sockets (on UNIX)

2007-06-11 Thread geoffbache
You could probably use the Asyncore stuff to do it as well (with a lot less stuff). This looked interesting. But it seems the asyncore stuff operates at the socket level, whereas I've currently just got a standard synchronous SocketServer and the socket operations themselves are kind of

Re: Threads, signals and sockets (on UNIX)

2007-06-11 Thread geoffbache
On Jun 11, 2:08 pm, Jean-Paul Calderone [EMAIL PROTECTED] wrote: On Mon, 11 Jun 2007 04:56:43 -0700, geoffbache [EMAIL PROTECTED] wrote: Twisted *should* be able to do this, as it uses non-blocking IO. http://twistedmatrix.com/trac/ Thanks for the tip. I'll take a look if nobody has any

Re: Threads, signals and sockets (on UNIX)

2007-06-11 Thread fumanchu
On Jun 11, 3:34 am, geoffbache [EMAIL PROTECTED] 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.