[Twisted-Python] How could I distinguish each TCP connection?

Eric Hsu nkeric at gmail.com
Tue Jun 21 01:20:11 EDT 2005


2005/6/21, Christopher Armstrong <radeex at gmail.com>:
> 
> You can do it based on the Protocol instance. For TCP, there is one
> Protocol instance per connection, and it has access to the transport.


Hi Christopher!

Big thanks first!

When I writing codes like the following to provide TCP/UDP services:

factory = Factory()
factory.protocol = MyTCPService
reactor.listenTCP(port1, factory)
reactor.listenUDP(port2, MyUDPService())

How could I get the protocol instance of each client and maintain them?
Please tell me more details if you could, since I'm very very new to twisted 
:)

- Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20050621/9cddd75f/attachment.htm 


More information about the Twisted-Python mailing list