#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.
TAO_Default_Endpoint_Selector::~TAO_Default_Endpoint_Selector | ( | void | ) | [virtual] |
void TAO_Default_Endpoint_Selector::select_endpoint | ( | TAO::Profile_Transport_Resolver * | r, | |
ACE_Time_Value * | val | |||
) | [virtual] |
Select the endpoint and set r's profile_
.
Implements TAO_Invocation_Endpoint_Selector.
Definition at line 30 of file Invocation_Endpoint_Selectors.cpp.
References ENOTSUP.
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 while (r->stub ()->next_profile_retry () != 0); 00076 00077 // If we get here, we completely failed to find an endpoint 00078 // that we know how to use. We used to throw an exception 00079 // but that would prevent any request interception points 00080 // being called. They may know how to fix the problem so 00081 // we wait to throw the exception in 00082 // Synch_Twoway_Invocation::remote_twoway and 00083 // Synch_Oneway_Invocation::remote_oneway instead. 00084 }