diff options
author | bala <balanatarajan@users.noreply.github.com> | 2002-04-12 19:43:25 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2002-04-12 19:43:25 +0000 |
commit | 7b3700a7c380f1533b4367d999a303a9bfcba841 (patch) | |
tree | e7e885faf0922dc4062ebfc5041aa964e36aa88f /TAO/tao/Strategies/UIOP_Connector.cpp | |
parent | d1ba71698652c9c25edd26dadb0a2f7a947323a0 (diff) | |
download | ATCD-7b3700a7c380f1533b4367d999a303a9bfcba841.tar.gz |
ChangeLogTag: Fri Apr 12 14:14:01 2002 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/Strategies/UIOP_Connector.cpp')
-rw-r--r-- | TAO/tao/Strategies/UIOP_Connector.cpp | 124 |
1 files changed, 53 insertions, 71 deletions
diff --git a/TAO/tao/Strategies/UIOP_Connector.cpp b/TAO/tao/Strategies/UIOP_Connector.cpp index 3dff3014fc8..77279113a86 100644 --- a/TAO/tao/Strategies/UIOP_Connector.cpp +++ b/TAO/tao/Strategies/UIOP_Connector.cpp @@ -113,9 +113,8 @@ TAO_UIOP_Connector::close (void) int -TAO_UIOP_Connector::connect (TAO_GIOP_Invocation *invocation, - TAO_Transport_Descriptor_Interface *desc - ACE_ENV_ARG_DECL_NOT_USED) +TAO_UIOP_Connector::make_connect (TAO_GIOP_Invocation *invocation, + TAO_Transport_Descriptor_Interface *desc) { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, @@ -150,84 +149,67 @@ TAO_UIOP_Connector::connect (TAO_GIOP_Invocation *invocation, TAO_UIOP_Connection_Handler *svc_handler = 0; TAO_Transport *base_transport = 0; - // Check the Cache first for connections - // If transport found, reference count is incremented on assignment - if (this->orb_core ()->lane_resources ().transport_cache ().find_transport (desc, - base_transport) == 0) + if (TAO_debug_level > 2) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) UIOP_Connector::connect ") + ACE_TEXT ("making a new connection \n"))); + + // Purge connections (if necessary) + this->orb_core ()->lane_resources ().transport_cache ().purge (); + + if (max_wait_time != 0) { - if (TAO_debug_level > 5) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) UIOP_Connector::connect ") - ACE_TEXT ("got an existing transport with id %d \n"), - base_transport->id ())); + ACE_Synch_Options synch_options (ACE_Synch_Options::USE_TIMEOUT, + *max_wait_time); + + // We obtain the transport in the <svc_handler> variable. As + // we know now that the connection is not available in Cache + // we can make a new connection + result = this->base_connector_.connect (svc_handler, + remote_address, + synch_options); } else { - if (TAO_debug_level > 2) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) UIOP_Connector::connect ") - ACE_TEXT ("making a new connection \n"))); - - // Purge connections (if necessary) - this->orb_core ()->lane_resources ().transport_cache ().purge (); - - // @@ This needs to change in the next round when we implement a - // policy that will not allow new connections when a connection - // is busy. - if (max_wait_time != 0) - { - ACE_Synch_Options synch_options (ACE_Synch_Options::USE_TIMEOUT, - *max_wait_time); - - // We obtain the transport in the <svc_handler> variable. As - // we know now that the connection is not available in Cache - // we can make a new connection - result = this->base_connector_.connect (svc_handler, - remote_address, - synch_options); - } - else - { - // We obtain the transport in the <svc_handler> variable. As - // we know now that the connection is not available in Cache - // we can make a new connection - result = this->base_connector_.connect (svc_handler, - remote_address); - } + // We obtain the transport in the <svc_handler> variable. As + // we know now that the connection is not available in Cache + // we can make a new connection + result = this->base_connector_.connect (svc_handler, + remote_address); + } - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) UIOP_Connector::connect ") - ACE_TEXT ("The result is <%d> \n"), result)); + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) UIOP_Connector::connect ") + ACE_TEXT ("The result is <%d> \n"), result)); - if (result == -1) + if (result == -1) + { + // Give users a clue to the problem. + if (TAO_debug_level) { - // Give users a clue to the problem. - if (TAO_debug_level) - { - ACE_DEBUG ((LM_ERROR, - ACE_TEXT ("(%P|%t) %s:%u, connection to ") - ACE_TEXT ("%s failed (%p)\n"), - __FILE__, - __LINE__, - uiop_endpoint->rendezvous_point (), - ACE_TEXT ("errno"))); - } - return -1; + ACE_DEBUG ((LM_ERROR, + ACE_TEXT ("(%P|%t) %s:%u, connection to ") + ACE_TEXT ("%s failed (%p)\n"), + __FILE__, + __LINE__, + uiop_endpoint->rendezvous_point (), + ACE_TEXT ("errno"))); } + return -1; + } - 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, - base_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, + base_transport); - if (retval != 0 && TAO_debug_level > 0) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) UIOP_Connector::connect ") - ACE_TEXT ("could not add the new connection to Cache \n"))); - } + if (retval != 0 && TAO_debug_level > 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) UIOP_Connector::connect ") + ACE_TEXT ("could not add the new connection to Cache \n"))); } // No need to _duplicate and release since base_transport |