[Twisted-Python] How to forcibly disconnect PB client?

David Guaraglia dguaraglia at gmx.de
Thu Aug 25 10:12:22 EDT 2005

Hi Steve,

It depends, if you decide you should disconnect the client while 
processing data in the Protocol, then you can just 

class MyProt(Protocol):
       if data <> "hello":

So the most important question is: where do you decide that you should 
disconnect the client?

Hope this helps,


Steve Freitas wrote:

>In some cases I need to force a client to disconnect. Is there some
>factory call that I can use to do this? On the client side, I know I can
>use factory._broker.transport.loseConnection(), but on the server side,
>though I've looked at the source a bit, I'm not sure how to get at the
>correct transport.

More information about the Twisted-Python mailing list