summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-10-15 05:31:46 +0000
committermarina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-10-15 05:31:46 +0000
commitb513239988ad6710740d6e20e0127a2e8e8b5544 (patch)
treebd20fb9f671187422a32d69e9a8702abf78e0f10
parent44d419873cb27b372eba8f8bc89406c736744238 (diff)
downloadATCD-b513239988ad6710740d6e20e0127a2e8e8b5544.tar.gz
ChangeLogTag:Sun Oct 15 00:11:07 2000 Marina Spivak <marina@cs.wustl.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a23
-rw-r--r--TAO/tao/Connector_Registry.cpp12
-rw-r--r--TAO/tao/Invocation.cpp7
-rw-r--r--TAO/tao/Invocation_Endpoint_Selectors.cpp27
-rw-r--r--TAO/tao/Profile.cpp13
-rw-r--r--TAO/tao/Profile.h2
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 <marina@cs.wustl.edu>
+
+ * tao/Profile.h
+ * tao/Profile.cpp:
+
+ Removed <reset_hint> and <addr_to_string> 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 <marina@cs.wustl.edu>
* 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: