I wanted to ask a question about how to close a connection in twisted RPC .
I know that a similar question was asked, but it does not seem to answer me.
I am making a basic connection as shown below:
cfactory = pb.PBClientFactory() reactor.connectTCP(<host>, <port>, cfactory) dfr.addCallbacks(<callback>, <errfun>, ...) ... (in the <callback> func) remote.callRemote('myfunc', ...)
Everything works and does what I need.
But the problem is that I see that the connection is still active ("ESTABLISHED") if I check it on netstat -a .
Since I am doing this between a client and a server that has been working indefinitely, I cannot just continue to accumulate active connections.
I cannot stop the reactor for the same reason.
So, is there a way to close the connection without waiting for the creation of its own protocol?
At first I wanted to check, since this is all in working condition, with the exception of this fact. If possible, Iβll just add the right thing, and donβt start by setting up the protocol and all. Thank you for your attention and any general recommendations will be appreciated. Tony
source share