Select weirdness

Jean-Paul Calderone exarkun at divmod.com
Mon Apr 23 07:22:12 EDT 2007


On Mon, 23 Apr 2007 00:33:22 -0700, Ron Garret <rnospamon at flownet.com> wrote:
>In article <462c54cb$0$336$e4fe514c at news.xs4all.nl>,
> Irmen de Jong <irmen.NOSPAM at xs4all.nl> wrote:
>
>> Ron Garret wrote:
>> > I don't understand why socketserver calling select should matter.  (And
>> > BTW, there are no calls to select in SocketServer.py.  I'm using
>> > Python2.5.)
>>
>> You don't *need* a select at all.
>
>Yes I do, because what I'm really writing is a dispatching proxy that
>has to serve many simultaneous connections.

Calling select() in a while loop doesn't give you this.

> [snip]
>
>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.

Twisted does this out of the box, for what it's worth.

Jean-Paul



More information about the Python-list mailing list