summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelo Corsaro <angelo@icorsaro.net>2001-03-19 06:09:28 +0000
committerAngelo Corsaro <angelo@icorsaro.net>2001-03-19 06:09:28 +0000
commit9127c60fdb3612d4a9713403a4c46ac00e5e49aa (patch)
tree5c7acea55ab3a63e3fcd98d963424ff642cd7afc
parent5de01fea752112a9651ca07c8b9d6d380ebe594a (diff)
downloadATCD-9127c60fdb3612d4a9713403a4c46ac00e5e49aa.tar.gz
ChangeLogTag: Sun Mar 18 23:50:28 2001 Angelo Corsaro <corsaro@cs.wustl.edu>
-rw-r--r--TAO/tao/RT_Invocation_Endpoint_Selectors.cpp21
-rw-r--r--TAO/tests/RTCORBA/Banded_Connections/bands.nt2
-rw-r--r--TAO/tests/RTCORBA/Banded_Connections/client.cpp2
-rwxr-xr-xTAO/tests/RTCORBA/Banded_Connections/run_test.pl12
-rw-r--r--TAO/tests/RTCORBA/Banded_Connections/server.cpp4
5 files changed, 24 insertions, 17 deletions
diff --git a/TAO/tao/RT_Invocation_Endpoint_Selectors.cpp b/TAO/tao/RT_Invocation_Endpoint_Selectors.cpp
index 23fb31d3370..da654d4b39f 100644
--- a/TAO/tao/RT_Invocation_Endpoint_Selectors.cpp
+++ b/TAO/tao/RT_Invocation_Endpoint_Selectors.cpp
@@ -56,17 +56,22 @@ TAO_Priority_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation
{
// Profiles contains more than one endpoint. Find one with the
// right priority.
+
+ // Right now it is assumed that the priority bands are adjacent, and
+ // that for each priority band the ORB has an endpoint at a priority
+ // that is set to the maximum of the associated band.
TAO_Endpoint *endpoint = 0;
+ TAO_Endpoint *prev_endpoint = invocation->profile_->endpoint ();
for (TAO_Endpoint *endp = invocation->profile_->endpoint ();
endp != 0;
endp = endp->next ())
{
- if (endp->priority ()
- == invocation->endpoint_selection_state_.client_priority_)
+ if (endp->priority () > invocation->endpoint_selection_state_.client_priority_)
{
- endpoint = endp;
+ endpoint = prev_endpoint;
break;
}
+ prev_endpoint = endp;
}
if (endpoint != 0)
@@ -196,18 +201,18 @@ TAO_Protocol_Endpoint_Selector::~TAO_Protocol_Endpoint_Selector (void)
}
void
-TAO_Protocol_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation
+TAO_Protocol_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation
*invocation,
CORBA::Environment &ACE_TRY_ENV)
{
/// Narrow down to the right policy.
- RTCORBA::ClientProtocolPolicy_var cp_policy =
+ RTCORBA::ClientProtocolPolicy_var cp_policy =
RTCORBA::ClientProtocolPolicy::_narrow (
invocation->endpoint_selection_state_.
client_protocol_policy_,
ACE_TRY_ENV);
ACE_CHECK;
-
+
/// Cast to TAO_ClientProtocolPolicy
TAO_ClientProtocolPolicy *client_protocol_policy =
ACE_static_cast (TAO_ClientProtocolPolicy *,
@@ -216,7 +221,7 @@ TAO_Protocol_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation
/// Get the ProtocolList
RTCORBA::ProtocolList & protocols =
client_protocol_policy->protocols_rep ();
-
+
CORBA::ULong protocol_index =
invocation->endpoint_selection_state_.client_protocol_index_;
@@ -245,7 +250,7 @@ TAO_Protocol_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation
// Find a Profile for the next protocol we would like to try.
TAO_Profile *profile = 0;
TAO_MProfile& mprofile = invocation->stub_->base_profiles ();
-
+
for (TAO_PHandle i = 0;
i < mprofile.profile_count ();
++i)
diff --git a/TAO/tests/RTCORBA/Banded_Connections/bands.nt b/TAO/tests/RTCORBA/Banded_Connections/bands.nt
index 694762eaf76..c8b0cf9293b 100644
--- a/TAO/tests/RTCORBA/Banded_Connections/bands.nt
+++ b/TAO/tests/RTCORBA/Banded_Connections/bands.nt
@@ -1 +1 @@
-0 2 4 5 6 6 \ No newline at end of file
+0 2 3 4 5 6
diff --git a/TAO/tests/RTCORBA/Banded_Connections/client.cpp b/TAO/tests/RTCORBA/Banded_Connections/client.cpp
index 8c6c1a0f99d..b1580ad4b5a 100644
--- a/TAO/tests/RTCORBA/Banded_Connections/client.cpp
+++ b/TAO/tests/RTCORBA/Banded_Connections/client.cpp
@@ -135,7 +135,7 @@ invocation_exception_test (Test_ptr obj,
ACE_TRY_ENV);
ACE_TRY_CHECK;
- ACE_DEBUG ((LM_DEBUG, "Test failed: no exception caught\n"));
+ ACE_DEBUG ((LM_DEBUG, "Test Succeeded: no exception caught\n"));
}
ACE_CATCH (CORBA::INV_POLICY, ex)
{
diff --git a/TAO/tests/RTCORBA/Banded_Connections/run_test.pl b/TAO/tests/RTCORBA/Banded_Connections/run_test.pl
index 088e884a9da..ed1088bc5b5 100755
--- a/TAO/tests/RTCORBA/Banded_Connections/run_test.pl
+++ b/TAO/tests/RTCORBA/Banded_Connections/run_test.pl
@@ -28,25 +28,25 @@ print STDERR "\n********** RTCORBA Priority Banded Connections Unit Test\n";
$server_args =
"-n $iorfile1 -o $iorfile2 -b bands.unix -ORBSvcConf $server_conf "
."-ORBdebuglevel 1 -p 67 -w 78 "
- ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=66 "
- ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=75 "
+ ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=69 "
+ ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=76 "
."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=80 ";
$client_args =
"-n file://$iorfile1 -o file://$iorfile2 "
- ."-a 76 -b 80 -c 64";
+ ."-a 67 -b 75 -c 77";
if ($^O eq "MSWin32") {
$server_args =
"-n $iorfile1 -o $iorfile2 -b bands.nt -ORBSvcConf $server_conf "
."-ORBdebuglevel 1 -p 1 -w 3 "
."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=2 "
- ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=5 "
+ ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=4 "
."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=6 ";
$client_args =
"-n file://$iorfile1 -o file://$iorfile2 "
- ."-a 4 -b 6 -c 3";
+ ."-a 1 -b 4 -c 6 ";
}
$SV = new PerlACE::Process ("server", $server_args);
@@ -56,7 +56,7 @@ $SV->Spawn ();
if (PerlACE::waitforfile_timed ($iorfile2, 10) == -1) {
print STDERR "ERROR: cannot find file <$iorfile2>\n";
- $SV->Kill ();
+ $SV->Kill ();
exit 1;
}
diff --git a/TAO/tests/RTCORBA/Banded_Connections/server.cpp b/TAO/tests/RTCORBA/Banded_Connections/server.cpp
index 5207ebe4175..24de7167209 100644
--- a/TAO/tests/RTCORBA/Banded_Connections/server.cpp
+++ b/TAO/tests/RTCORBA/Banded_Connections/server.cpp
@@ -397,6 +397,8 @@ main (int argc, char *argv[])
// Servant.
Test_i server_impl (orb.in (), bands);
+ Test_i server_impl2 (orb.in (), bands);
+
// Test 1: Attempt to create a POA with priority bands but
// without the priority model. Should get POA::InvalidPolicy
@@ -513,7 +515,7 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG, "\nActivated object two as "));
result = create_object (server_declared_poa.in (),
orb.in (),
- &server_impl,
+ &server_impl2,
ior_output_file2,
ACE_TRY_ENV);
ACE_TRY_CHECK;