[omniORB] BIDIRECTIONAL_POLICY_TYPE=BOTH and MAIN_THREAD_MODEL

Elleke Bindi ellekebindi at googlemail.com
Mon Apr 2 14:29:05 BST 2012


Hi all,

I'm trying to use omniORB in bidirectional communication mode (like in
the "bidir" example) together with the MAIN_THREAD_MODEL model (like
in the "poa\threading" example). The policy list I use looks like
that:

CORBA::PolicyList pl;
pl.length(2);
CORBA::Any a;
a <<= BiDirPolicy::BOTH;
pl[0] = orbVar->create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE, a);
pl[1] = rootpoa->create_thread_policy(PortableServer::MAIN_THREAD_MODEL);

The problem is, that when using the MAIN_THREAD_MODEL, the other
policy seems not to work. To test it I've removed the
MAIN_THREAD_MODEL line - then the BIDIRECTIONAL_POLICY_TYPE=BOTH was
working fine.

Here the small part of the trace >>without<< MAIN_THREAD_MODE ("bidir"
working fine):
...
omniORB: (3) Accepted request from
giop:tcp:[::ffff:192.168.123.27]:55872 to switch to bidirectional
because of this rule: "* tcp,bidir"
omniORB: (3) Dispatching remote call 'register' to: root/bidir<0> (active)
...
omniORB: (0) Invoke 'callBack' on remote: root/bidir<0>
omniORB: (0) sendChunk: to giop:tcp:[::ffff:192.168.123.27]:55872 68 bytes
...
As you can see the incoming and outgoing port numer are the same.

Here the same stuff of >>with<< MAIN_THREAD_MODE:
...
omniORB: (3) Accepted request from
giop:tcp:[::ffff:192.168.123.27]:55942 to switch to bidirectional
because of this rule: "* tcp,bidir"
omniORB: (3) Dispatching remote call 'register' to: root/bidir<0> (active)
omniORB: (3) Creating ref to remote: root/bidir<0>
 target id      : IDL:cb/Client:1.0
 most derived id: IDL:cb/Client:1.0
omniORB: (3) Preparing to dispatch 'register' to main thread
omniORB: (0) Main thread dispatch 'register'
...
omniORB: (0) Client attempt to connect to giop:tcp:192.168.123.27:1001
omniORB: (0) Client opened connection to giop:tcp:192.168.123.27:1001
...
omniORB: (0) Invoke 'callBack' on remote: root/bidir<0>
omniORB: (0) Send codeset service context: (ISO-8859-1,UTF-16)
omniORB: (0) sendChunk: to giop:tcp:192.168.123.27:1001 88 bytes
...
In this case the server has opened connection to another port for
sending the callBack, i.e. the connection is not working in "bidir"
mode.

Is it possible to get those two policies working together?

I'm using: windows 7 32bit, VS2008, omniORB 4.1.4.

Cheers,
Elleke



More information about the omniORB-list mailing list