[omniORB] problem with bidirectional feature

Fernando A. de Araujo Filho maverick@elogica.com.br
Thu Dec 5 12:49:02 2002


Thank you Slava,

>Hi, Fernando.
>Your client and server builded by analogy with bidir example? (particularly
>you  create separate poa with BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE =
>BiDirPolicy::BOTH?)
>--
>Slava Garelin

Yes, I have created a separated POA, "derived" from
"rootPoaRef->create_Poa(...,...,...) ", with BIDIR policy.

I sent to you the code of modified bidir sample.
Now the client "sleep"  10 (n) seconds, before redo the same task once more
on server.
I put this "sleep time" to simulate the same condition in my application.
Occurs the same "not expected behavior".

The test is : open two consoles/command prompt windows. Start bd_server.
Copy IOR, run bd_client with server IOR and two more parameters like
"bd_client <server_IOR>  1 3",
when "******* bd_client SLEEPING *******" is displayed on console, quickly
kill and restart the server,
that is the test.

If you have 5 minutes ... make the 3 tests below :

In all tests, the first sequence of calls between the client and server
works fine.

TEST 1 :
The parameters below in both sides
argv1[6] = strdup("-ORBofferBiDirectionalGIOP");
argv1[7] = strdup("0");
argv1[8] = strdup("-ORBacceptBiDirectionalGIOP");
argv1[9] = strdup("0");

// Dont apply  any BIDIRECTIONAL feature
CORBA::PolicyList pl;
pl.length(2);
pl[0] = rootpoa->create_lifespan_policy(PortableServer::PERSISTENT);
pl[1] = rootpoa->create_id_assignment_policy(PortableServer::USER_ID);
PortableServer::POA_var poa = rootpoa->create_POA("bidir", pman, pl);

When the client start sleeping "******* bd_client SLEEPING *******" is
displayed, quickly, kill the server and restart it.
After client sleep time, the client call the server OK.
**************************************************************
TEST 2:
ONLY, on client side, change the parameter below
argv1[6] = strdup("-ORBofferBiDirectionalGIOP");
argv1[7] = strdup("1");   // <<<<

When the client start sleeping "******* bd_client SLEEPING *******" is
displayed , quickly, kill the server and restart it.
, after sleep time, when the client try to "locate" the server, you will see
a TRANSIENT CALLTIMEDOUT EXCEPTION. I dont understand, because
the unique thing changed was the client parameter offerBiDirectionalGIOP.
**************************************************************
TEST3
The parameters below in both sides
argv1[6] = strdup("-ORBofferBiDirectionalGIOP");
argv1[7] = strdup("1");
argv1[8] = strdup("-ORBacceptBiDirectionalGIOP");
argv1[9] = strdup("1");

apply  BIDIRECTIONAL policy
CORBA::PolicyList pl;
pl.length(3);
CORBA::Any a;
a <<= BiDirPolicy::BOTH;
pl[0] = orb->create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE, a);
pl[1] = rootpoa->create_lifespan_policy(PortableServer::PERSISTENT);
pl[2] = rootpoa->create_id_assignment_policy(PortableServer::USER_ID);
PortableServer::POA_var poa = rootpoa->create_POA("bidir", pman, pl);

When the client start sleeping, quickly, kill the server and restart it.
, after sleep time, when the client try to "locate" the server, you will see
a TRANSIENT CALLTIMEDOUT EXCEPTION.
***************************************************************

The modifications on bidir sample are simple.
See on bd_server.cc and bd_client.cc.
Please, tell me if I have done something wrong.

Many thanks Slava,

Fernando A. de Araujo Filho
maverick@elogica.com.br