diff options
author | bala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-10-27 18:57:01 +0000 |
---|---|---|
committer | bala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-10-27 18:57:01 +0000 |
commit | f5748750bacbddf6de6e1311d9e1e2f9bfc394de (patch) | |
tree | 26cf6938eb178d3586d27bb44ed57a726302da33 /TAO/tao/Invocation_Endpoint_Selectors.cpp | |
parent | c9a0df3009cc95aa8e4e48b414ec8add4607c72c (diff) | |
download | ATCD-f5748750bacbddf6de6e1311d9e1e2f9bfc394de.tar.gz |
ChangeLogTag: Sat Oct 27 13:49:14 2001 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/Invocation_Endpoint_Selectors.cpp')
-rw-r--r-- | TAO/tao/Invocation_Endpoint_Selectors.cpp | 59 |
1 files changed, 39 insertions, 20 deletions
diff --git a/TAO/tao/Invocation_Endpoint_Selectors.cpp b/TAO/tao/Invocation_Endpoint_Selectors.cpp index b8b07ed3df0..10deba29a5f 100644 --- a/TAO/tao/Invocation_Endpoint_Selectors.cpp +++ b/TAO/tao/Invocation_Endpoint_Selectors.cpp @@ -37,26 +37,13 @@ TAO_Default_Endpoint_Selector::select_endpoint ( invocation->profile (invocation->stub ()->profile_in_use ()); invocation->endpoint (invocation->profile ()->endpoint ()); - size_t endpoint_count = invocation->profile ()->endpoint_count(); - for (size_t i = 0; i < endpoint_count; ++i) - { - // If known endpoint, select it. - if (invocation->endpoint () != 0) - { - TAO_Base_Transport_Property desc (invocation->endpoint ()); - - int status = - invocation->perform_call (desc, ACE_TRY_ENV); - ACE_CHECK; - - // Check if the invocation has completed. - if (status == 1) - return; - - // Go to the next endpoint in this profile. - invocation->endpoint (invocation->endpoint()->next()); - } - } + int status = + this->endpoint_from_profile (invocation, + ACE_TRY_ENV); + ACE_CHECK; + + if (status == 1) + return; } while (invocation->stub ()->next_profile_retry () != 0); @@ -113,3 +100,35 @@ TAO_Default_Endpoint_Selector::close_connection (TAO_GIOP_Invocation *invocation // FRED For now we will not deal with recursive forwards! invocation->stub ()->reset_profiles (); } + + +int +TAO_Default_Endpoint_Selector::endpoint_from_profile ( + TAO_GIOP_Invocation *invocation, + CORBA::Environment &ACE_TRY_ENV) +{ + size_t endpoint_count = + invocation->profile ()->endpoint_count(); + + for (size_t i = 0; i < endpoint_count; ++i) + { + // If known endpoint, select it. + if (invocation->endpoint () != 0) + { + TAO_Base_Transport_Property desc (invocation->endpoint ()); + + int status = + invocation->perform_call (desc, ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + // Check if the invocation has completed. + if (status == 1) + return 1; + + // Go to the next endpoint in this profile. + invocation->endpoint (invocation->endpoint()->next()); + } + } + + return 0; +} |