[Python-ideas] Supporting already opened sockets in our socket-based server classes
mwm at mired.org
Wed Jun 6 19:46:18 CEST 2012
On Wed, 06 Jun 2012 17:23:15 +0200
Tarek Ziadé <tarek at ziade.org> wrote:
> On 6/6/12 2:28 PM, Antoine Pitrou wrote:
> > Le 06/06/2012 09:56, Tarek Ziadé a écrit :
> >> What I am proposing is the following syntax:
> >> if the host passed to the class is of the form:
> >> fd://12
> >> The class will try to create a socket object against the file descriptor
> >> 12, and will not bind() it neither accept() it.
> > Passing a pseudo-URL where a host name is expected sounds like a bad idea.
> Well, unix sockets are using this convention to point paths to unix sockets.
> e.g. unix:///some/path
I think what you're trying to achieve has merit, but you're doing it
in the wrong place. Using a URL-like string instead of a host name?
So how about a new subclass, "PreForkedTCPServer", that takes the file
descriptor instead of the host/port pair when created? You'd probably
want to tweak the class tree somewhat, but that seems like a more
palatable API for what you're trying to do.
Mike Meyer <mwm at mired.org> http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
More information about the Python-ideas