[Twisted-Python] What the hell?

Glyph Lefkowitz glyph at twistedmatrix.com
Sat Sep 1 19:35:56 MDT 2001


On Sun, Sep 02, 2001 at 01:05:08AM +0300, Moshe Zadka wrote:

> I'd like (at least) Port to be able to take a bound socket, instead of
> binding it itself. Then have a couple of convinience routines
> 
> def InetPort(factory, port, interface='', backlog=5):
>     sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>     sock.bind( (interface, port) )
>     sock.listen(backlog)
>     return Port(factory, socket, 'INET')
> 
> def UnixPort(factory, port, interface='', backlog=5):
>     ...
>     return Port(factory, socket, 'UNIX')

That would make the Port instance impossible to persist, and adds no value,
unless there's some particular external API we need to interact with that
speaks in terms of sockets...

-- 
                      ______      __   __  _____  _     _
                     |  ____ |      \_/   |_____] |_____|
                     |_____| |_____  |    |       |     |
                     @ t w i s t e d m a t r i x  . c o m
                     http://twistedmatrix.com/users/glyph





More information about the Twisted-Python mailing list