[Twisted-Python] protocol-factory question

Luca Politti luca at unipex.it
Fri Jun 22 05:08:07 EDT 2007


Hi group, I'm new in this mailing list and in twisted...
I want to ask you a question about twisted factory and protocols:
I'm building a server that have to receive commands from some clients 
via TCP.

So I wrote my Protocol class, and my Factory class. If I understood the 
behavior of
this system, every time a client connects to my server, factory build a 
protocol instance and
"attach" it to the client. So the client comunicates with that protocol 
instance, right?
Now, when from protocol I call self.transport.loseConnection(in way to 
disconnnect itself),
the client will be disconnected,but its protocol instance still lives 
on. What can I do
to destroy protocol instance after its client disconnection? Because if 
I have a thousand of
connection attempts, I'll have a thousand of protocol instances, with a 
lot of allocated resources

I hope I've been clear enough, even if my english is far to be perfect :)

Thanks a lot

Luca




More information about the Twisted-Python mailing list