[Twisted-Python] How to disconnect a client, when you only have an instance of pb.PBClientFactory ?

Luc Stepniewski luc.stepniewski at adelux.fr
Wed May 17 11:56:24 EDT 2006


I'm still trying to kill a hung PB client connection to a server. I noticed 
the timeout parameter in reactor.connectTCP() is not what I what, as it is 
only used once the connection is established (PB handshake).
I'm trying to kill a connection that didn't manage to make the PB handshake 
(for example when instead of having a PB server, you have a server that 
replies to TCP but not to PB, like a netcat program).

So my idea is to launch a callLater that, if the connection is still present 
after 5 seconds (the callLater hasn't been cancelled), will close the client 
connection. The problem is that I just have an instance of 
pb.PBClientFactory, and I cannot find in the forest of methods which one I 
could use to cut that connection (if that's possible).

I attached a small test file, if my explanation was really clear :-)

Thanks for your help,
Luc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: killit.py
Type: application/x-python
Size: 2118 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20060517/c18b7c35/attachment.bin 


More information about the Twisted-Python mailing list