[Twisted-Python] APIs changes for TCP and UDP

Itamar Shtull-Trauring twisted at itamarst.org
Wed Jun 5 04:43:27 MDT 2002


1) Client TCP connects should be allowed to bind to a specific interface and 
port, e.g.:

   reactor.clientTCP('example.com', 80, p, bindAddress=('1.2.3.4', 999))

2) UDP Ports's API should be formalized. Basically, the way UDP works from 
what I can see is that you create a Port, and for client connections you 
call the Port's createConnection(addr) method. Currently this returns a 
transport which is hooked up to a protocol, which is silly, it should return 
the protocol instance it contructs:

   port = reactor.listenUDP(8080, dnsFactory)
   clientProtocol = port.createConnection(("example.com", 53))
   clientProtocol.query("....")





More information about the Twisted-Python mailing list