[omniORB] Using sockets for local servants...

Álvaro Vega García avega at tid.es
Fri Feb 1 08:53:10 GMT 2008


Hi,

On Thu, 2008-01-31 at 09:49 +0000, Duncan Grisby wrote:
> On Wednesday 30 January, "Jiva DeVoe" wrote:
> 
> > I have an application which has two servants in the same process.  I
> > think (correct me if I'm wrong) that if I try to connect to a servant
> > within my own process that omniORB tries to be smart and uses shared
> > memory for it's communication.  Is this true?  I want my application
> > to ALWAYS use sockets when communicating to my servant - event if the
> > client and servant are in the same process.  Is it possible to
> > configure this?
> 
> omniORB will indeed always use a local case optimisation for calls in
> the same process. There's no "shared memory" involved in the sense of
> System V shared memory or something like that -- it's just a call within
> a process. You can't stop omniORB from doing that.
> 
I don't know if the following is possible with omniORB, I suppose that
yes, but another way to obtain a communication across TCP/IP network
could be to have 2 ORB in the same process.
In first ORB you can register servant1 and publish IOR1 (ie. in a file
after an orb1->object_to_string()). In the second ORB you can register
servant2 and publish IOR2. Then servant1 must obtain IOR2 using
orb1->string_to_object() and servant2 must obtain IOR1 using
orb2->string_to_object(). 

Then, when servant1 invokes an operation over servant2 using his
reference, the CORBA communication will happen across TCP/IP network,
because ORB1 has a remote reference to servant2 (which had not been
published by him).

I hope it could be useful for you.

Álvaro   

> Why do you want all calls to go through sockets?
> 
> Duncan.
> 





More information about the omniORB-list mailing list