Problem:
- Product Name: VBE
- Product Version: 5.2.1
- Product Component: BiDir
- Platform/OS Version: All
For VisiBroker the following property allows clients and servers to use Bi-Directional GIOP communication:
vbroker.orb.enableBiDir=
How to configure non-visibroker clients to allow Bi-Directional connections?
Resolution:
For a BiDir connection the ORB in question must fully support CORBA 2.3 or above (specifically GIOP 1.2 where BiDir is introduced).
When BiDir is required the ORB includes a service context in the request message indicating that the client orb will accept requests coming on that connection (making the request-reply traffic two-way rather than the traditional one-way). This context is added to any request that is passing an object reference in its parameter list (which is the object the call-back is being made to).
The CORBA spec details a way to specify the BiDir availability through policies set on the callback object"s POA as follows:
In Java code will look something like this:
import org.omg.BiDirPolicy.*;
...
Any bidirPolicy = orb.create_any();
bidirPolicy.insert_short(BOTH.value);
policy = {orb.create_policy(BIDIRECTIONAL_POLICY_TYPE.value, bidirPolicy);
// Then add that policy to the policies being used for the callback
// object"s POA in the create_POA method
In C the code will look like this:
BiDirPolicy::BidirectionalPolicy_var bd_policy;
CORBA::Any bd_both;
bd_both
CORBA::Policy_var policy = orb->create_policy(
BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE,
bd_both);
bd_policy = BiDirPolicy::BidirectionalPolicy::_narrow(policy);
// And add that policy to the policies for the create_POA method
// being used to activate the callback object.
A variation on the above code should work for all ORBs (including visibroker) that allow BiDir GIOP. There may be additional steps involved for some ORB"s (or options to specify which objects accept BiDir requests). Users should check the documentation for the ORB in each case.
#Security
#VisiBroker




