Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / BiDir_GIOP / BiDir_Service_Context_Handler.cpp
blob50c7eebee6e7b9120ce0e5fc66c28fdd132854bc
1 #include "tao/BiDir_GIOP/BiDir_Service_Context_Handler.h"
2 #include "tao/CDR.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
12 int
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);
24 int
25 TAO_BiDIR_Service_Context_Handler::generate_service_context (
26 TAO_Stub *,
27 TAO_Transport& transport,
28 TAO_Operation_Details &opdetails,
29 TAO_Target_Specification &,
30 TAO_OutputCDR &msg)
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 ());
49 return 0;
52 TAO_END_VERSIONED_NAMESPACE_DECL