[Python-ideas] Supporting already opened sockets in our socket-based server classes

Tarek Ziadé tarek at ziade.org
Wed Jun 6 23:45:18 CEST 2012


On 6/6/12 7:46 PM, Mike Meyer wrote:
> 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?
> Really?
>
> 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.

Yeah that makes sense. will try this - thanks for the feedback

>
>        <mike




More information about the Python-ideas mailing list