[Twisted-Python] Explicitly closing an AMP connection?

Nathan nathan.stocks at gmail.com
Wed Apr 16 11:54:00 MDT 2008


>  Since AMP is an IProtocol implementation, it is given a reference to its
>  transport via the makeConnection method (commonly inherited from Protocol
>  and not overridden - the base implementation sets it as an attribute of
>  itself, `transport´).  The way to close a TCP connection is to call the
>  transport's loseConnection method.  So if you have a reference to a
>  connected AMP instance and you want to disconnect it, you can do
>
>    theProto.transport.loseConnection()

Perfect, thanks!

~ Nathan




More information about the Twisted-Python mailing list