[Twisted-Python] Explicit disconnect from pb

Uwe C. Schroeder uwe at oss4u.com
Mon Jul 21 21:47:04 EDT 2003

On Monday 21 July 2003 06:35 pm, Andrew Bennetts wrote:
> On Mon, Jul 21, 2003 at 06:21:05PM -0700, Uwe C. Schroeder wrote:
> > Hi,
> >
> > I looked qround, but I can't find any information on how to disconnect
> > from a pb session without ending the client.
> >
> > I have a service which I'm connecting to. Some time later I want to
> > disconnect from this service to free up ressources ( the service keeps
> > database connections etc, and I want to get rid of them ).
> > The only thing I have on the client side is a remotereference to the
> > perspective instance. So how do I disconnect from something I don't have
> > a reference to ? Somehow there must be something I can call to disconnect
> > the session (and on the server side trigger the disconnect handlers)
> This sounds related to this bug:
>     http://twistedmatrix.com/bugs/issue62

Yep, sound like it.
What I just tried ( and what partially works, at least for my purpose) is to 
have a perspective_disconnect method in the perspective class which just 
free's up the ressources I want to get rid of. certainly the connection still 
hangs around until I close the client. I my case droping the database 
connection which is no longer in use is more of a concern, so that works for 
me. (each client opens 2 database connections at startup - one is solely for 
login and gui definitions and has no password, the second is started after 
login. Therefor I don't need the first connection anymore. But I need to 
close the db connection since this server is intended to serve possibly up to 
500 clients at a time, which would be 500 useless db connections)


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