diff options
Diffstat (limited to 'TAO/tao/Strategies/SHMIOP_Connector.cpp')
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Connector.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/TAO/tao/Strategies/SHMIOP_Connector.cpp b/TAO/tao/Strategies/SHMIOP_Connector.cpp index 8b6f21e84c9..440522991d1 100644 --- a/TAO/tao/Strategies/SHMIOP_Connector.cpp +++ b/TAO/tao/Strategies/SHMIOP_Connector.cpp @@ -124,7 +124,6 @@ TAO_SHMIOP_Connector::make_connect (TAO_GIOP_Invocation *invocation, ACE_TEXT ("TAO (%P|%t) Connector::connect - ") ACE_TEXT ("looking for SHMIOP connection.\n"))); - TAO_Transport *&transport = invocation->transport (); ACE_Time_Value *max_wait_time = invocation->max_wait_time (); TAO_Endpoint *endpoint = desc->endpoint (); @@ -160,7 +159,6 @@ TAO_SHMIOP_Connector::make_connect (TAO_GIOP_Invocation *invocation, int result = 0; TAO_SHMIOP_Connection_Handler *svc_handler = 0; - TAO_Transport *base_transport = 0; if (TAO_debug_level > 2) ACE_DEBUG ((LM_DEBUG, @@ -216,11 +214,13 @@ TAO_SHMIOP_Connector::make_connect (TAO_GIOP_Invocation *invocation, return -1; } - base_transport = TAO_Transport::_duplicate (svc_handler->transport ()); + TAO_Transport *base_transport = + TAO_Transport::_duplicate (svc_handler->transport ()); + // Add the handler to Cache int retval = this->orb_core ()->lane_resources ().transport_cache ().cache_transport (desc, - svc_handler->transport ()); + base_transport); if (retval != 0 && TAO_debug_level > 0) { @@ -229,8 +229,20 @@ TAO_SHMIOP_Connector::make_connect (TAO_GIOP_Invocation *invocation, ACE_TEXT ("could not add the new connection to Cache \n"))); } - // No need to _duplicate and release since base_transport - // is going out of scope. transport now has control of base_transport. + + // If the wait strategy wants us to be registered with the reactor + // then we do so. + retval = base_transport->wait_strategy ()->register_handler (); + + if (retval != 0 && TAO_debug_level > 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_LIB_TEXT ("(%P|%t) IIOP_Connector::connect ") + ACE_LIB_TEXT ("could not add the new connection to reactor \n"))); + } + + // Handover the transport pointer to the Invocation class. + TAO_Transport *&transport = invocation->transport (); transport = base_transport; return 0; |