Discussion:
[omniORB] Client disconnect event
Tuyen Chau
2006-10-13 03:22:53 UTC
Permalink
Hi everybody,

This question may have been asked before, but is there a way in omniORB
to know if a client has disconnected?

I'm aware that we can build that into the IDL and have the client call
the server before it exits, ie. a clean shutdown. However, I'm more
interested in detecting unexpected client disconnects, such as network
failure, crashes, which usually have to be detected at the socket
level? Is there such an event in omniORB?

Thanks,
Tuyen
Wernke zur Borg
2006-10-13 12:41:35 UTC
Permalink
Post by Tuyen Chau
Hi everybody,
This question may have been asked before, but is there a way
in omniORB
to know if a client has disconnected?
I'm aware that we can build that into the IDL and have the
client call
the server before it exits, ie. a clean shutdown. However, I'm more
interested in detecting unexpected client disconnects, such
as network
failure, crashes, which usually have to be detected at the socket
level? Is there such an event in omniORB?
Thanks,
Tuyen
There is no concept of a high-level connection between client and
server. Conceptually CORBA maintains a transport connection only for the
duration of a single operation. If this breaks during the operation the
invoker will be notified with an exception.

If you need a connection oriented application protocol you will have to
build something into your IDL. For instance, you could think of a
"Session" interface that once established is regularly polled to be
alive with a suitable operation. For instance, we are using a simple
Session::alive() operation which the client must call every so many
seconds, and which the server expects to be called by the client. The
operation does nothing but return, and as long as it returns, the
session is ok.

Regards, Wernke
Duncan Grisby
2006-10-13 13:19:00 UTC
Permalink
Post by Tuyen Chau
This question may have been asked before, but is there a way in
omniORB to know if a client has disconnected?
I'm aware that we can build that into the IDL and have the client call
the server before it exits, ie. a clean shutdown. However, I'm more
interested in detecting unexpected client disconnects, such as network
failure, crashes, which usually have to be detected at the socket
level? Is there such an event in omniORB?
Clients do not keep connections permanently open, so what you want is
not possible. Both clients and servers are permitted to close
connections at any time, so closure of a connection doesn't tell you
anything about whether a client is still present or not.

To do what you want, you have to build your own keep-alive scheme by
sending pings or something equivalent.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...