From b513239988ad6710740d6e20e0127a2e8e8b5544 Mon Sep 17 00:00:00 2001 From: marina Date: Sun, 15 Oct 2000 05:31:46 +0000 Subject: ChangeLogTag:Sun Oct 15 00:11:07 2000 Marina Spivak --- TAO/ChangeLogs/ChangeLog-02a | 23 +++++++++++++++++++++++ TAO/tao/Connector_Registry.cpp | 12 ++++-------- TAO/tao/Invocation.cpp | 7 ++++--- TAO/tao/Invocation_Endpoint_Selectors.cpp | 27 ++++++++++++++++++++++----- TAO/tao/Profile.cpp | 13 ------------- TAO/tao/Profile.h | 2 -- 6 files changed, 53 insertions(+), 31 deletions(-) diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index e33966c7be5..d5177908ff8 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,26 @@ +Sun Oct 15 00:11:07 2000 Marina Spivak + + * tao/Profile.h + * tao/Profile.cpp: + + Removed and methods from + TAO_Unknown_Profile since they were removed from TAO_Profile. + + * tao/Connector_Registry.cpp + * tao/Invocation_Endpoint_Selectors.cpp: + + Added logic for handling TAO_Unknown_Profile(s), i.e., protocols + the ORB does not understand, during profile selection and + connection establishment. When the ORB encounters an unknown + profile, it transparently retries with the next appropriate one. + (Handling unknown protocols worked in the past, but was broken + with the introduction of Endpoint component to the PP framework. + This change restores the functionality.) + + * tao/Invocation.cpp: + + Added comment. + Sat Oct 14 19:49:39 2000 Marina Spivak * tao/tests/RTCORBA/Client_Protocol/server.cpp: diff --git a/TAO/tao/Connector_Registry.cpp b/TAO/tao/Connector_Registry.cpp index 036ba63e877..0f858c40841 100644 --- a/TAO/tao/Connector_Registry.cpp +++ b/TAO/tao/Connector_Registry.cpp @@ -268,19 +268,15 @@ TAO_Connector_Registry::connect (TAO_Endpoint *endpoint, ACE_Time_Value *max_wait_time, CORBA::Environment &ACE_TRY_ENV) { - // Find the appropriate connector object + if (endpoint == 0) + return -1; + + // Find the appropriate connector object. TAO_Connector *connector = this->get_connector (endpoint->tag ()); if (connector == 0) - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) Connector_Registry::connect - ") - ACE_TEXT ("protocol %u not available.\n"), - endpoint->tag ())); return -1; - } return connector->connect (endpoint, transport, diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index f0a0dfd8e6c..008b3dc2f14 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -207,6 +207,7 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV) if (this->transport_ != 0) this->transport_->idle (); + // Obtain a connection. int result = conn_reg->connect (this->endpoint_, this->transport_, this->max_wait_time_, @@ -488,14 +489,14 @@ TAO_GIOP_Invocation::create_ior_info (void) return mprofile.get_current_handle (); } -void +void TAO_GIOP_Invocation::add_rt_service_context (CORBA_Environment &ACE_TRY_ENV) { // RTCORBA-specific processing. // If invocation target supports RTCORBA::CLIENT_PROPAGATED priority // model, we must add IOP::RTCorbaPriority service context to the - // list. + // list. #if (TAO_HAS_RT_CORBA == 1) @@ -514,7 +515,7 @@ TAO_GIOP_Invocation::add_rt_service_context (CORBA_Environment TAO_OutputCDR cdr; if ((cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER) == 0) - || (cdr << this->endpoint_selection_state_.client_priority_) + || (cdr << this->endpoint_selection_state_.client_priority_) == 0) ACE_THROW (CORBA::MARSHAL ()); diff --git a/TAO/tao/Invocation_Endpoint_Selectors.cpp b/TAO/tao/Invocation_Endpoint_Selectors.cpp index 7438cbf36e4..6f5ef669a28 100644 --- a/TAO/tao/Invocation_Endpoint_Selectors.cpp +++ b/TAO/tao/Invocation_Endpoint_Selectors.cpp @@ -264,9 +264,16 @@ TAO_Default_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation *invocation, CORBA::Environment &ACE_TRY_ENV) { - ACE_UNUSED_ARG (ACE_TRY_ENV); invocation->profile_ = invocation->stub_->profile_in_use (); invocation->endpoint_ = invocation->profile_->endpoint (); + + if (invocation->endpoint_ == 0) + { + // Unknown protocol - move onto the next profile. + this->next (invocation, ACE_TRY_ENV); + ACE_CHECK; + this->select_endpoint (invocation, ACE_TRY_ENV); + } } void @@ -337,7 +344,15 @@ TAO_Priority_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation // Select an endpoint from the profile. - if (invocation->profile_->endpoint_count () == 1) + if (invocation->profile_->endpoint_count () == 0) + { + // Unknown protocol - move onto the next profile. + this->next (invocation, ACE_TRY_ENV); + ACE_CHECK; + this->select_endpoint (invocation, ACE_TRY_ENV); + } + + else if (invocation->profile_->endpoint_count () == 1) { // Profile contains just one endpoint. This happens when: // a) we are talking to a nonTAO server (which doesn't have @@ -454,10 +469,12 @@ TAO_Protocol_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation } } - if (profile == 0) + if (profile == 0 + || profile->endpoint_count () == 0) { - // If no Profile for the protocol of interest were found, - // try another protocol. + // If either no profile for the protocol of interest were found + // or profile was found but client ORB doesn't understand the + // protocol, try another protocol. invocation->endpoint_selection_state_.client_protocol_index_++; this->select_endpoint (invocation, ACE_TRY_ENV); } diff --git a/TAO/tao/Profile.cpp b/TAO/tao/Profile.cpp index db7633eed0e..3370c053def 100644 --- a/TAO/tao/Profile.cpp +++ b/TAO/tao/Profile.cpp @@ -308,19 +308,6 @@ TAO_Unknown_Profile::hash (CORBA::ULong max, this->body_.length ()) % max); } -int -TAO_Unknown_Profile::addr_to_string (char * /* buffer */, - size_t /* length */) -{ - return -1; -} - -void -TAO_Unknown_Profile::reset_hint (void) -{ - // do nothing -} - IOP::TaggedProfile& TAO_Unknown_Profile::create_tagged_profile (void) { diff --git a/TAO/tao/Profile.h b/TAO/tao/Profile.h index 42f1765e5c4..2e10a076b39 100644 --- a/TAO/tao/Profile.h +++ b/TAO/tao/Profile.h @@ -233,8 +233,6 @@ public: virtual CORBA::Boolean is_equivalent (const TAO_Profile* other_profile); virtual CORBA::ULong hash (CORBA::ULong max, CORBA::Environment &ACE_TRY_ENV); - virtual int addr_to_string(char *buffer, size_t length); - virtual void reset_hint (void); virtual IOP::TaggedProfile &create_tagged_profile (void); private: -- cgit v1.2.1