[Twisted-Python] How to forcibly disconnect PB client?
sflist at ihonk.com
Thu Aug 25 10:35:30 EDT 2005
Thanks for the reply. I'm aware of using loseConnection() from inside
the protocol, but I'm using PBServerFactory. So I'm looking for a way to
choose an arbitrary PB client that's already connected and logged in
(cred) through that factory and kill the connection -- in other words,
of all the clients that may be connected to that factory, I need to know
how to get the transport that I want, so I can call loseConnection() on
If I need to subclass PBServerFactory, that's fine, but I'm hoping to
find something a little more direct.
On Thu, 2005-08-25 at 11:12 -0300, David Guaraglia wrote:
> 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.
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
More information about the Twisted-Python