[omniORB] How to detect death of a client?

Martin Kaul (LOG) mkaul@leuze-owen.de
Tue, 10 Nov 1998 08:55:06 +0100


Swayamjit Das wrote:
> 
> Michael Nikonov wrote:
> 
> > In my application, when client suddenly dies (for example, due to a
> > crash or when user turns
> > off his machine without shutting down the client application), server
> > must be aware of
> > this fact because it must free resources associated with that client
> > (like memory buffers
> > or database connection).
> >
> 
> We face a similar problem in our application. The solution that we have, is
> to implement a application level"Keep Alive" message using CORBA. The client
> sends this message periodically to the server. There is
> a thread on the server that monitors all the "Keep Alive" msgs. If a client
> fails to send a "Keep Alive" message
> by certain time, then the client is considered dead and the resources
> corresponding to that client are cleaned up.
> 
> I guess this is a crude approach. Is there a smarter way of getting around
> this problem. ?
In my applications the server holds a list of clients an poll cyclicaly
the
clients. I developed a special pair of client and server classes who
manage
this. If the polling failed (an exception throws), the server catch the
exception and calls a defined disconnection function...

bye
  Martin