[Twisted-Python] correct way to disconnect a pb connection?

Uwe C. Schroeder uwe at oss4u.com
Thu Oct 13 01:01:54 MDT 2005


Don't know if this is the way to go, but what I'm doing is to call a 
server-side "disconnect" method, which will do some cleanup and then call the 
transport.loseConnection() on the server.
The client has an error handler which will catch that "lost connection" error 
and terminate gracefully.

Maybe that helps

UC


On Wednesday 12 October 2005 23:51, Tobias Sargeant wrote:
> Hi,
>
> Is there a correct way to disconnect a pb client? all the examples seem
> to call reacctor.stop() which is not what I want. Calling
> broker.transport.loseConnection() seems clean on the client side, but
> on the server side I see lots of these:
>
> 2005/10/13 16:47 EST [ControldServerConnection,0,192.168.34.218]
> connection lost <Q.controld.controld.ControldServerConnection instance
> at 0x102cd78> [Failure instance: Traceback (failure with no frames):
> twisted.internet.error.ConnectionLost: Connection to the other side was
> lost in a non-clean fashion.
>
> I've hunted through the source, but thus far haven't even been able to
> ascertain where the exception is originally being raised.
>
> Cheers,
> Toby.

--
Open Source Solutions 4U, LLC	2570 Fleetwood Drive
Phone:  +1 650 872 2425		San Bruno, CA 94066
Cell:   +1 650 302 2405		United States
Fax:    +1 650 872 2417




More information about the Twisted-Python mailing list