[omniORB] Client crash notification & Smart Proxies

Stefan Seefeld seefelds@MAGELLAN.UMontreal.CA
Wed, 20 Dec 2000 17:10:21 -0500


JohnSwanStone wrote:
> 
> Stefan,
> 
> Thanks for you reply.
> 
> I'd like to avoid forcing the clients into using a RefCount_var type holder
> which can be error prone (i.e. very easy to forget to use it) ... instead
> I'd like to provide smart proxies which do the same thing.  I'm not
> concerned with portability ... I'm willing to rewrite the smart proxies for
> each new ORB.

I don't understand your argument. First of all, as I tried to show, my template
*is* kind of a 'smart proxy'. Of course, you need to use it everywhere to get
the same effect as modifying the original _ptr types.
Second, there is no way around distributed ref counting. Even in case of smart
proxies as you envision them you need some server side API to refer to. Using
the interface I proposed does just that.

> What I'd like to know is how can one create "smart" proxies in omniORB?

ok, given that you don't need portability, you are willing to mandate both sides
to use the same ORB (omniORB). Given further that omniORB is Free Software (LGPL),
you can just take the source code, and add the two facilities I proposed into the
core (i.e. include the increment/decrement methods into a modified version of
PortableServer::ServantBase, etc.). However, you need to make sure that you always 
use omni on both ends of your connection, and refuse anything else. This lock-in is 
something I would avoid by all means, which is why I would suggest to stick with public extensions
instead of ORB side extensions. Beside, the fact that the base class for servants
is called 'PortableServer::ServantBase' has a reason.

> I'd also like to know if there is any omniORB specific notification that can
> be given to the server whenever a client crashes?  I'd like to avoid the
> polling-the-client method you suggested.  It's my understanding that when
> one end of a TCP/IP connection crashes the other is notified.  Does omniORB
> do anything with this notification? Can I get a hook into it?

I think you are wrong here. A connection may well be shut down if it is not used
for a given time. It can then be reestablished as soon as a request is issued.
low level (tcp/ip) connection is unrelated from a CORBA level connection.

> I also understand that omniORB supports a TCP/IP connection per request,

that's wrong.

> which after a time are closed.  Can I configure omniORB to always keep at
> least 1 connection open for each unique client?  That way I could receive
> the TCP/IP connection closed message I spoke about in the previous
> paragraph.

not without modifying the ORB. You can certainly set connection timeouts,
but there is no notification upcall from the ORB to the application code, as
a tcp/ip connection lifetime is quite unrelated to a client server connection
(in terms of holding remote IORs).

Regards,	Stefan
_______________________________________________________              
              
Stefan Seefeld
Departement de Physique
Universite de Montreal
email: seefelds@magellan.umontreal.ca

_______________________________________________________

      ...ich hab' noch einen Koffer in Berlin...