Discussion:
[omniORB] Using sockets for local servants...
Jiva DeVoe
2008-01-30 23:48:53 UTC
Permalink
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?
Duncan Grisby
2008-01-31 15:49:35 UTC
Permalink
Post by Jiva DeVoe
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.

Why do you want all calls to go through sockets?

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Álvaro Vega García
2008-02-01 13:53:29 UTC
Permalink
Hi,
Post by Duncan Grisby
Post by Jiva DeVoe
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
Post by Duncan Grisby
Why do you want all calls to go through sockets?
Duncan.
evgeni.rojkov at durr.com ()
2008-02-01 15:37:55 UTC
Permalink
Post by Duncan Grisby
... could be to have 2 ORB in the same process ...
As I have heard ones omniORB is singleton.
- calling ORB_init() several time initialise only ones.
- orb->shutdown() will shutdown all servants you have (it is really the case,
tested myself :-).
Please correct me if I am wrong.
Regards, Evgeni


-----Urspr?ngliche Nachricht-----
Von: omniorb-list-***@omniorb-support.com
[mailto:omniorb-list-***@omniorb-support.com] Im Auftrag von ?lvaro Vega
Garc?a
Gesendet: Freitag, 1. Februar 2008 08:53
An: Duncan Grisby
Cc: Jiva DeVoe; omniorb-***@omniorb-support.com
Betreff: Re: [omniORB] Using sockets for local servants...


Hi,
Post by Duncan Grisby
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
Post by Duncan Grisby
Why do you want all calls to go through sockets?
Duncan.
Duncan Grisby
2008-02-02 00:35:33 UTC
Permalink
Post by Álvaro Vega García
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.
That isn't possible with omniORB. omniORB only supports having one ORB
in a process.

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