Previous Table of Contents Next


15.9 Bi-directional GIOP policy

   In GIOP protocol versions 1.0 and 1.1, there are strict rules on which side of a connection can issue what type of messages (for example version 1.0 and 1.1 clients can not issue GIOP reply messages). However, as documented above, it is sensible to relax this restriction if the ORB supports this functionality and policies dictate that bidirectional connection are allowed. To indicate a bi-directional policy, the following is defined.

   // Self contained module for Bi-directional GIOP policy

   module BiDirPolicy {

   typedef unsigned short BidirectionalPolicyValue; const BidirectionalPolicyValue NORMAL = 0; const BidirectionalPolicyValue BOTH = 1;

   const CORBA::PolicyType BIDIRECTIONAL_POLICY_TYPE = 37;

    interface BidirectionalPolicy : CORBA::Policy { readonly attribute BidirectionalPolicyValue value; }; };

   A BidirectionalPolicyValue of NORMAL states that the usual GIOP restrictions of who can send what GIOP messages apply (i.e., bi-directional connections are not allowed). A value of BOTH indicates that there is a relaxation in what party can issue what GIOP messages (i.e., bi-directional connections are supported). The default value of a BidirectionalPolicy is NORMAL.

   In the absence of a BidirectionalPolicy being passed in the PortableServer::POA::create_POA operation, a POA will assume a policy value of NORMAL.

   A client and a server ORB must each have a BidirectionalPolicy with a value of BOTH for bi-directional communication to take place.

   To create a BidirectionalPolicy, the ORB::create_policy operation is used.