1 #include "tao/BiDir_GIOP/BiDir_Service_Context_Handler.h"
3 #include "tao/TAO_Server_Request.h"
4 #include "tao/Transport.h"
5 #include "tao/ORB_Core.h"
6 #include "tao/GIOP_Message_Base.h"
7 #include "tao/operation_details.h"
8 #include "tao/Transport_Mux_Strategy.h"
10 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
13 TAO_BiDIR_Service_Context_Handler::process_service_context (
14 TAO_Transport
& transport
,
15 const IOP::ServiceContext
& context
,
16 TAO_ServerRequest
* /*request*/)
18 TAO_InputCDR
cdr (reinterpret_cast<const char*> (
19 context
.context_data
.get_buffer ()),
20 context
.context_data
.length ());
21 return transport
.tear_listen_point_list (cdr
);
25 TAO_BiDIR_Service_Context_Handler::generate_service_context (
27 TAO_Transport
& transport
,
28 TAO_Operation_Details
&opdetails
,
29 TAO_Target_Specification
&,
32 if (transport
.orb_core ()->bidir_giop_policy () &&
33 transport
.messaging_object ()->is_ready_for_bidirectional (msg
) &&
34 transport
.bidirectional_flag () < 0)
36 transport
.set_bidir_context_info (opdetails
);
38 // Set the flag to 1 (i.e., originating side)
39 transport
.bidirectional_flag (1);
41 // At the moment we enable BiDIR giop we have to get a new
42 // request id to make sure that we follow the even/odd rule
43 // for request id's. We only need to do this when enabled
44 // it, after that the Transport Mux Strategy will make sure
45 // that the rule is followed
46 opdetails
.request_id (transport
.tms ()->request_id ());
52 TAO_END_VERSIONED_NAMESPACE_DECL