#include <Invocation_Endpoint_Selectors.h>
Inheritance diagram for TAO_Default_Endpoint_Selector:
Public Member Functions | |
virtual | ~TAO_Default_Endpoint_Selector (void) |
Destructor. | |
virtual void | select_endpoint (TAO::Profile_Transport_Resolver *r, ACE_Time_Value *val) |
Select the endpoint and set r's profile_ . |
This strategy is used when there are no policies set or when the only policy set is RTCORBA::PriorityModelPolicy and its value is RTCORBA::SERVER_DECLARED. The strategy is to try the first endpoint from the first profile in the IOR. If that doesn't work, try the next profile, and so on.
Definition at line 87 of file Invocation_Endpoint_Selectors.h.
|
Destructor.
Definition at line 25 of file Invocation_Endpoint_Selectors.cpp.
00026 { 00027 } |
|
Select the endpoint and set r's
Implements TAO_Invocation_Endpoint_Selector. Definition at line 30 of file Invocation_Endpoint_Selectors.cpp. References TAO::Profile_Transport_Resolver::blocked_connect(), ENOTSUP, TAO_Stub::next_profile_retry(), TAO::Profile_Transport_Resolver::profile(), TAO_Stub::profile_in_use(), TAO::Profile_Transport_Resolver::stub(), TAO::Profile_Transport_Resolver::try_connect(), TAO::Profile_Transport_Resolver::try_parallel_connect(), and TAO::Profile_Transport_Resolver::use_parallel_connect().
00032 { 00033 do 00034 { 00035 r->profile (r->stub ()->profile_in_use ()); 00036 00037 // Check whether we need to do a blocked wait or we have a 00038 // non-blocked wait and we support that. If this is not the 00039 // case we can't use this profile so try the next. 00040 if (r->blocked_connect () || 00041 (!r->blocked_connect () && 00042 r->profile ()->supports_non_blocking_oneways ())) 00043 { 00044 if (r->profile ()->endpoint_count () > 1 && 00045 r->use_parallel_connect()) 00046 { 00047 TAO_Endpoint *ep = r->profile ()->endpoint (); 00048 00049 TAO_Base_Transport_Property desc (ep); 00050 00051 // Check if the connect has completed. 00052 if (r->try_parallel_connect (&desc, max_wait_time)) 00053 return; 00054 // The default implementation of try_parallel_connect returns 00055 // a not supported errno. In this case, allow the ordinary 00056 // connection mechanism to be tried. OTOH, if the connection 00057 // attempt failed for some other reason, then abandon this 00058 // profile and try the next one in the list. 00059 else if (errno != ENOTSUP) 00060 continue; 00061 } 00062 00063 for (TAO_Endpoint *ep = r->profile ()->first_filtered_endpoint (); 00064 ep != 0; 00065 ep = r->profile ()->next_filtered_endpoint (ep)) 00066 { 00067 TAO_Base_Transport_Property desc (ep); 00068 00069 // Check if the connect has completed. 00070 if (r->try_connect (&desc, max_wait_time)) 00071 return; 00072 } 00073 00074 } 00075 } 00076 while (r->stub ()->next_profile_retry () != 0); 00077 00078 // If we get here, we completely failed to find an endpoint selector 00079 // that we know how to use, so throw an exception. 00080 throw ::CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO); 00081 } |