In article <[EMAIL PROTECTED]>, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> En Mon, 23 Apr 2007 04:33:22 -0300, Ron Garret <[EMAIL PROTECTED]> > escribió: > > > I have not been able to find a proxy server that can proxy to unix > > sockets, so I need to write my own. Conceptually its a very simple > > thing: read the first line of an HTTP request, parse it with a regexp to > > extract the sandbox name, connect to the appropriate unix server socket, > > and then bidirectionally pipe bytes back and forth. But it has to do > > this for multiple connections simultaneously, which is why I need select. > > No. This is what the *server* should do, not the *handler*. The server > listens on incoming requests, and creates a new handler for each one. > Inside a handler, you don't have to worry about multiple connections. > If you want to process simultaneous connections, inherit your server from > ThreadingMixIn or ForkingMixIn (or use one of the predefined server > classes). Ah, good point. But that still leaves the problem of keep-alive connections. I still need to be able to forward data in both directions without knowing ahead of time when it will arrive. (I think I can solve the problem by using send and recv directly BTW.) rg
-- http://mail.python.org/mailman/listinfo/python-list