Re: using ORBit_small_listen_for_broken() with bonobo objects



On Mon, 2004-07-12 at 23:40, Gustavo J. A. M. Carneiro wrote:
> A Seg, 2004-07-12 às 20:28, Ben Liblit escreveu:
> > Gustavo J. A. M. Carneiro wrote:
> > >   CORBA_Object ref = BONOBO_OBJREF(server);
> > 
> > Ah, I knew it had to be something simple.  Thanks.
> > 
> > > ORBit_small_listen_for_broken() is meant to be used by the clients of a
> > > particular server object do detect when the connection with the server
> > > got lost.  In the server side there is no connection with its own
> > > objects, so...
> > 
> > ...so it won't even trigger the callback?
> 
>   No.  There is no "connection", how can Bonobo monitor something that
> doesn't exist?
> 
> > 
> > Hmm.  That's too bad.  When a client dies, the server is left holding an 
> > instance created by that client which will never be destroyed.  It's 
> > effectively a leak.  Is there no way to detect and clean up after dead 
> > clients?
> 
>   No.
> 
>   Unless the client exposes some object and you keep a reference to it. 
> Then, you could listen for the connection to the client object and
> unref() the local object when the client disconnects.

This is what the gnome-vfs daemon does. Its a very complicated setup,
and it requires a large amount of care to get both sides to clean up
correctly on connection breakup.

Its a possible way, but I wouldn't recommend it if its possible to
avoid.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a globe-trotting drug-addicted inventor possessed of the uncanny powers 
of an insect. She's a wealthy African-American opera singer from a secret 
island of warrior women. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]