summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ACE/ChangeLog39
-rw-r--r--ACE/NEWS3
-rw-r--r--ACE/ace/CDR_Stream.inl2
-rw-r--r--ACE/ace/QtReactor/QtReactor.cpp12
-rwxr-xr-xACE/bin/auto_run_tests.pl23
-rw-r--r--ACE/bin/tao_orb_tests.lst1
-rw-r--r--TAO/ChangeLog150
-rw-r--r--TAO/NEWS18
-rw-r--r--TAO/orbsvcs/Notify_Service/Notify_Service.cpp65
-rw-r--r--TAO/orbsvcs/Notify_Service/Notify_Service.h9
-rw-r--r--TAO/orbsvcs/Notify_Service/README12
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp67
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp10
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Consumer.h1
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp116
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h5
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp23
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Properties.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Properties.h20
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Properties.inl24
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_Properties.cpp11
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/RT_Properties.h12
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp54
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Service.h3
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp58
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1393_Regression/run_test.pl4
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2615_Regression/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/Event/Performance/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/locked/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Basic/run_test.pl5
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl4
-rwxr-xr-xTAO/orbsvcs/tests/RTCosScheduling/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/Security/Big_Request/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/Security/Callback/run_test.pl2
-rwxr-xr-xTAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl2
-rw-r--r--TAO/tao/GIOP_Message_State.cpp15
-rw-r--r--TAO/tao/GIOP_Utils.h4
-rw-r--r--TAO/tao/ObjectKey_Table.cpp26
-rw-r--r--TAO/tao/ObjectKey_Table.h2
-rw-r--r--TAO/tao/Unbounded_Octet_Sequence_T.h24
-rw-r--r--TAO/tests/Bug_2702_Regression/CloseConnection.mpc13
-rw-r--r--TAO/tests/Bug_2702_Regression/README18
-rw-r--r--TAO/tests/Bug_2702_Regression/Test.idl20
-rw-r--r--TAO/tests/Bug_2702_Regression/client.cpp81
-rw-r--r--TAO/tests/Bug_2702_Regression/closeconnection.datbin0 -> 12 bytes
-rw-r--r--TAO/tests/Bug_2702_Regression/fakeserver.pm151
-rwxr-xr-xTAO/tests/Bug_2702_Regression/fakeserver2.pl138
-rwxr-xr-xTAO/tests/Bug_2702_Regression/run_test.pl60
-rwxr-xr-xTAO/tests/COIOP/run_test.pl2
-rwxr-xr-xTAO/tests/DLL_ORB/run_test.pl2
-rwxr-xr-xTAO/tests/Portable_Interceptors/IORInterceptor/run_test.pl2
-rwxr-xr-xTAO/tests/Portable_Interceptors/PICurrent/run_test.pl2
-rwxr-xr-xTAO/tests/Portable_Interceptors/PolicyFactory/run_test.pl2
-rwxr-xr-xTAO/tests/Portable_Interceptors/Request_Interceptor_Flow/run_test.pl2
-rwxr-xr-xTAO/utils/nslist/run_test.pl4
62 files changed, 1235 insertions, 126 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index d39c1179688..cf4ad604f1b 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,42 @@
+Wed Jan 3 05:53:04 UTC 2007 Chris Cleeland <cleeland_c@ociweb.com>
+
+ This entry documents the merge of several small bug fixes from
+ the OCI distribution.
+
+ * ace/QtReactor/QtReactor.cpp:
+
+ Merged in a change from OCITAO 1.4a that fixed a bug in
+ ACE_QtReactor::QtWaitForMultipleEvents() where
+ the two select() calls in that function might select on different
+ handler sets. The problem is the dispatch_set/wait_set can be
+ changed during the two select() calls. This could happen while
+ waiting for an event, another event is handled and dispatched
+ which changes the dispatch_set/wait_set.
+
+ This bug was found on a single thread Qt application [RT 8751].
+
+ * ace/CDR_Stream.inl (adjust):
+
+ Applied a one-line change from Dan Troesser <troesser_d at
+ ociweb dot com>, originally committed to OCITAO 1.4a. VC8
+ detected that memory around a buffer was being modified.
+ Changed a boundary check from <= check to < that some believed
+ was causing a write past the end of the buffer. After the
+ change, there were no compilation problems with VC8 and all the
+ ACE CDR-related tests passed.
+
+ * bin/tao_orb_tests.lst:
+
+ Add in Bug_2702_Regression test.
+
+ * bin/auto_run_tests.pl:
+
+ Change the search logic for listed tests so that the script
+ "finds" tests even when the layout isn't using the "traditional"
+ layout where $TAO_ROOT == $ACE_ROOT/TAO.
+
+ * NEWS: Updated to reflect these changes.
+
Wed Jan 3 05:26:07 UTC 2007 J.T. Conklin <jtc@acorntoolworks.com>
* configure.ac:
diff --git a/ACE/NEWS b/ACE/NEWS
index 615bf924350..b80339fce75 100644
--- a/ACE/NEWS
+++ b/ACE/NEWS
@@ -17,6 +17,9 @@ PLANNED CHANGES FOR "ACE-5.5.5"
USER VISIBLE CHANGES BETWEEN ACE-5.5.4 and ACE-5.5.5
====================================================
+. Fixed a bug in ACE_QtReactor where the two select() calls in that function
+ might select on different handler sets.
+
. ACE_SOCK_IO::recvv(iovec[], size_t, const ACE_Time_Value* = 0) and
ACE_SOCK_IO::sendv (const iovec[], size_t, const ACE_Time_Value* = 0) methods
were changed to specify the iovec count argument as int instead of size_t
diff --git a/ACE/ace/CDR_Stream.inl b/ACE/ace/CDR_Stream.inl
index f2d6724ce7b..87903ec4fc4 100644
--- a/ACE/ace/CDR_Stream.inl
+++ b/ACE/ace/CDR_Stream.inl
@@ -454,7 +454,7 @@ ACE_OutputCDR::adjust (size_t size,
char *end = buf + size;
- if (end <= this->current_->end () &&
+ if (end < this->current_->end () &&
end >= buf)
{
#if !defined (ACE_LACKS_CDR_ALIGNMENT)
diff --git a/ACE/ace/QtReactor/QtReactor.cpp b/ACE/ace/QtReactor/QtReactor.cpp
index 79d196fc2a7..28682e17109 100644
--- a/ACE/ace/QtReactor/QtReactor.cpp
+++ b/ACE/ace/QtReactor/QtReactor.cpp
@@ -565,6 +565,12 @@ ACE_QtReactor::QtWaitForMultipleEvents (int width,
ACE_Select_Reactor_Handle_Set &wait_set,
ACE_Time_Value * /*max_wait_time*/)
{
+ // Keep a copy of the wait set in case the wait_set be changed
+ // between the two select calls in this function. It could happen
+ // while waiting for an event, another event is handled and dispatched
+ // which changes the dispatch_set_/wait_set.
+ ACE_Select_Reactor_Handle_Set orig_wait_set = wait_set;
+
// Check to make sure our handle's are all usable.
ACE_Select_Reactor_Handle_Set temp_set = wait_set;
@@ -584,9 +590,9 @@ ACE_QtReactor::QtWaitForMultipleEvents (int width,
// Now actually read the result needed by the <Select_Reactor> using
// <select>.
return ACE_OS::select(width,
- wait_set.rd_mask_,
- wait_set.wr_mask_,
- wait_set.ex_mask_,
+ orig_wait_set.rd_mask_,
+ orig_wait_set.wr_mask_,
+ orig_wait_set.ex_mask_,
(ACE_Time_Value *) &ACE_Time_Value::zero);
}
diff --git a/ACE/bin/auto_run_tests.pl b/ACE/bin/auto_run_tests.pl
index 4c8cd34e502..6c7a98aae67 100755
--- a/ACE/bin/auto_run_tests.pl
+++ b/ACE/bin/auto_run_tests.pl
@@ -17,7 +17,7 @@ use English;
use Getopt::Std;
use Cwd;
-use Env qw(ACE_ROOT PATH);
+use Env qw(ACE_ROOT PATH TAO_ROOT CIAO_ROOT);
################################################################################
@@ -118,16 +118,21 @@ foreach my $test_lst (@file_list) {
print "auto_run_tests: $test\n";
}
- $status = 0;
- if (-d $ACE_ROOT."/$directory") {
- $status = chdir ($ACE_ROOT."/$directory");
+ if ($directory =~ m:^TAO/(.*):) {
+ $directory = $1;
}
- elsif (-d $startdir."/$directory") {
- $status = chdir ($startdir."/$directory");
- }
- else {
- $status = chdir ($directory);
+
+ $status = undef;
+ foreach my $path ($ACE_ROOT."/$directory",
+ $startdir."/$directory",
+ $TAO_ROOT."/$directory" )
+ {
+ if (-d $path) {
+ $status = chdir ($path);
+ last;
+ }
}
+ $status = chdir ($directory) if (! defined($status));
if (!$status) {
print STDERR "ERROR: Cannot chdir to $ACE_ROOT/$directory\n";
diff --git a/ACE/bin/tao_orb_tests.lst b/ACE/bin/tao_orb_tests.lst
index 9a1737849e4..c0319b2e7cf 100644
--- a/ACE/bin/tao_orb_tests.lst
+++ b/ACE/bin/tao_orb_tests.lst
@@ -10,6 +10,7 @@
# NOTE: This file contains tests only for TAO's ORB. Please do not
# include things like performance-tests, and examples here.
+TAO/tests/Bug_2702_Regression/run_test.pl:
TAO/tests/ORB_Local_Config/Bunch/run_test.pl:
TAO/tests/ORB_Local_Config/Bug_1459/run_test.pl: SSL !STATIC
TAO/tests/ORB_Local_Config/Bug_2612/run_test.pl: !ST !STATIC !ACE_FOR_TAO
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 9c526cdd23b..57abb020934 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,153 @@
+Wed Jan 3 05:58:08 UTC 2007 Chris Cleeland <cleeland_c@ociweb.com>
+
+ This entry documents the merge of several small bug fixes from
+ the OCI distribution.
+
+ * orbsvcs/Notify_Service/README:
+
+ Add documentation for the new "-UseSeparateDispatchingORB"
+ option.
+
+ * orbsvcs/Notify_Service/Notify_Service.h:
+ * orbsvcs/Notify_Service/Notify_Service.cpp:
+
+ Add new methods for creating the dispatching ORB and a flag for
+ indicating whether a separate dispatching ORB should be used.
+
+ * orbsvcs/orbsvcs/Notify/Properties.h:
+ * orbsvcs/orbsvcs/Notify/Properties.inl:
+ * orbsvcs/orbsvcs/Notify/Properties.cpp:
+
+ Added methods and data member related to managing the separate
+ dispatching ORB.
+
+ * orbsvcs/orbsvcs/Notify/Properties.h (instance):
+ * orbsvcs/orbsvcs/Notify/Properties.cpp (instance):
+ * orbsvcs/orbsvcs/Notify/RT_Properties.h (instance):
+ * orbsvcs/orbsvcs/Notify/RT_Properties.cpp (instance):
+
+ Merged in a change similar to "Thu May 19 00:29:35 2005 Ossama
+ Othman <ossama@dre.vanderbilt.edu>" that avoids multiple
+ singleton instances of the Properties singleton.
+
+ * orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp (init):
+ * orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp (init):
+ * orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp (init):
+
+ Similar change in all three of these places substitutes
+ _unchecked_narrow() for _narrow() when using the "re-hosting"
+ technique for the a separate dispatching ORB. For the reference
+ to the consumer itself, the _unchecked_narrow() is perfectly
+ fine because we had a reference to something of that type
+ already. For the NotifyPublish narrowing, though, the
+ _unchecked_narrow() isn't completely sufficient. However, we
+ want to avoid a normal _narrow() because the resulting _is_a()
+ invocation could end up deadlocking if the POA that's hosting
+ the object reference for the consumer has not yet been
+ activated. Thus, we use pseudo-lazy evaluation for that,
+ described in the entry for Consumer.{h,cpp} below.
+
+ * orbsvcs/orbsvcs/Notify/Consumer.h:
+
+ Added a flag, have_not_yet_verified_publish_, that indicates
+ whether the type of this->publish_ has been verified to actually
+ be a reference to something implementing the NotifyPublish
+ interface.
+
+ * orbsvcs/orbsvcs/Notify/Consumer.cpp (CTOR, dispatch_updates_i):
+
+ Modified CTOR to initialize the aforementioned flag. In
+ dispatch_updates_i, we assume that the reference is unverified
+ until we've checked it once. I don't think we need to worry
+ about thread safety here...at least I hope not.
+
+ * orbsvcs/orbsvcs/Notify/CosNotify_Service.h (init_service2, init_i2):
+ * orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp (init_service2, init_i2):
+
+ Added code to parse the new option.
+
+ * orbsvcs/orbsvcs/Notify/POA_Helper.cpp (create_i, activate):
+
+ Corrected some minor memory leaks when getting the name of a
+ POA.
+
+ * orbsvcs/tests/Notify/Basic/run_test.pl:
+ * orbsvcs/tests/Notify/Basic/run_test_ipv6.pl:
+
+ Added an outer loop that runs the basic tests with and without a
+ separate dispatching ORB.
+
+ * tao/ObjectKey_Table.h:
+ * tao/ObjectKey_Table.cpp:
+ * tao/Unbounded_Octet_Sequence_T.h:
+
+ Added an optimization to servant activation. This change
+ removes the overhead of calling TAO::ObjectKey::operator[] and
+ TAO::unbounded_value_sequence<CORBA::Octet>::operator[]. The
+ main benefit of not calling these methods is that check_bounds()
+ is not called. check_bounds () is not required since the
+ length of the two arrays are taken into account. This change
+ provides about 30% decrease in servant activation time for a
+ debug build (tested on Windows VC71 and Linux gcc using OCITAO
+ 1.4a). The implementation uses ACE_OS::memcmp which could
+ possibly be optimized similar to ACE_HAS_SLOW_MEMSET. This
+ change originated from OCITAO 1.4a as part of RT 8571.
+
+ * tao/GIOP_Message_State.cpp (parse_message_header_i):
+
+ Fixed a problem where TAO mistakenly considered ALL messages
+ with zero-length payload to be errors and was thus not
+ properly parsing and handling the GIOP CloseConnection
+ message.
+
+ * tao/GIOP_Utils.h:
+
+ Corrected comment incorrectly indicating that
+ CloseConnection could not be send by both sides of a
+ connection.
+
+ * tests/Bug_2702_Regression/CloseConnection.mpc:
+ * tests/Bug_2702_Regression/README:
+ * tests/Bug_2702_Regression/Test.idl:
+ * tests/Bug_2702_Regression/client.cpp:
+ * tests/Bug_2702_Regression/closeconnection.dat:
+ * tests/Bug_2702_Regression/fakeserver.pm:
+ * tests/Bug_2702_Regression/fakeserver2.pl:
+ * tests/Bug_2702_Regression/run_test.pl:
+
+ Added a test to simulate the receipt of a CloseConnection in a
+ client, similar to what the original reporter experienced.
+ See the accompanying README for details.
+
+ * orbsvcs/tests/Bug_1393_Regression/run_test.pl:
+ * orbsvcs/tests/Bug_1395_Regression/run_test.pl:
+ * orbsvcs/tests/Bug_1436_Regression/run_test.pl:
+ * orbsvcs/tests/Bug_1437_Regression/run_test.pl:
+ * orbsvcs/tests/Bug_2615_Regression/run_test.pl:
+ * orbsvcs/tests/Event/Performance/run_test.pl:
+ * orbsvcs/tests/ImplRepo/NameService/run_test.pl:
+ * orbsvcs/tests/ImplRepo/locked/run_test.pl:
+ * orbsvcs/tests/ImplRepo/run_test.pl:
+ * orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl:
+ * orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl:
+ * orbsvcs/tests/RTCosScheduling/run_test.pl:
+ * orbsvcs/tests/Security/Big_Request/run_test.pl:
+ * orbsvcs/tests/Security/Callback/run_test.pl:
+ * orbsvcs/tests/Security/Secure_Invocation/run_test.pl:
+ * tests/COIOP/run_test.pl:
+ * tests/DLL_ORB/run_test.pl:
+ * tests/Portable_Interceptors/IORInterceptor/run_test.pl:
+ * tests/Portable_Interceptors/PICurrent/run_test.pl:
+ * tests/Portable_Interceptors/PolicyFactory/run_test.pl:
+ * tests/Portable_Interceptors/Request_Interceptor_Flow/run_test.pl:
+ * utils/nslist/run_test.pl:
+
+ Changed relative paths to $ACE_ROOT/bin in these scripts to
+ reference directly via the ACE_ROOT environment variable so
+ that the scripts would work properly when run in a workspace
+ that does not use the traditional everything-under-ACE_wrappers
+ directory hierarchy.
+
Wed Jan 3 00:51:49 UTC 2007 Iliyan Jeliazkov <iliyan@ociweb.com>
* tests/TransportCurrent/Framework/client.cpp:
diff --git a/TAO/NEWS b/TAO/NEWS
index be2db9bceba..a374f9dee42 100644
--- a/TAO/NEWS
+++ b/TAO/NEWS
@@ -32,6 +32,7 @@ PLANNED CHANGES FOR "TAO-5.5.5"
a value != 0. For more details of how the feature is intended
to be used, see docs/transport_current/index.html
+
USER VISIBLE CHANGES BETWEEN TAO-1.5.4 and TAO-1.5.5
====================================================
@@ -58,6 +59,23 @@ USER VISIBLE CHANGES BETWEEN TAO-1.5.4 and TAO-1.5.5
this means that the IDL compiler doesn't generate any environment macros
anymore.
+. Fixed a problem where TAO mistakenly considered ALL messages
+ with zero-length payload to be errors and was thus not properly
+ parsing and handling the GIOP CloseConnection message. This is
+ tested via Bug_2702_Regression.
+
+. Added an optimization to servant activation to eliminate calls to
+ check_bounds() on the object key sequence. This has been observed
+ to yield a 30% decrease in activation time for debug builds on VC71
+ and linux gcc.
+
+. Merged in changes from OCI's distribution which originate from
+ OCI request tickets [RT 8449] and [RT 8881]. In their totality,
+ these changes add a feature whereby the notification service
+ implementation can utilize a separate ORB for dispatching events to
+ consumers.
+
+
USER VISIBLE CHANGES BETWEEN TAO-1.5.3 and TAO-1.5.4
====================================================
diff --git a/TAO/orbsvcs/Notify_Service/Notify_Service.cpp b/TAO/orbsvcs/Notify_Service/Notify_Service.cpp
index e7d95c4dd99..ed5898ccb63 100644
--- a/TAO/orbsvcs/Notify_Service/Notify_Service.cpp
+++ b/TAO/orbsvcs/Notify_Service/Notify_Service.cpp
@@ -24,6 +24,7 @@ TAO_Notify_Service_Driver::TAO_Notify_Service_Driver (void)
, notify_channel_name_ (NOTIFY_CHANNEL_NAME)
, register_event_channel_ (0)
, nthreads_ (1)
+, separate_dispatching_orb_ (false)
{
// No-Op.
}
@@ -73,6 +74,22 @@ TAO_Notify_Service_Driver::init_ORB (int& argc, ACE_TCHAR *argv []
}
int
+TAO_Notify_Service_Driver::init_dispatching_ORB (int& argc, ACE_TCHAR *argv []
+ ACE_ENV_ARG_DECL)
+{
+ // Copy command line parameter.
+ ACE_Argv_Type_Converter command_line(argc, argv);
+
+ this->dispatching_orb_ = CORBA::ORB_init (command_line.get_argc(),
+ command_line.get_ASCII_argv(),
+ "dispatcher"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
TAO_Notify_Service_Driver::init (int argc, ACE_TCHAR *argv[]
ACE_ENV_ARG_DECL)
{
@@ -97,8 +114,22 @@ TAO_Notify_Service_Driver::init (int argc, ACE_TCHAR *argv[]
return -1;
}
- this->notify_service_->init_service (this->orb_.in () ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ if (this->separate_dispatching_orb_)
+ {
+ if (this->init_dispatching_ORB (argc, argv
+ ACE_ENV_ARG_PARAMETER) != 0)
+ {
+ return -1;
+ }
+
+ this->notify_service_->init_service2 (this->orb_.in (), this->dispatching_orb_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ else
+ {
+ this->notify_service_->init_service (this->orb_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
if (this->nthreads_ > 0) // we have chosen to run in a thread pool.
{
@@ -303,6 +334,12 @@ TAO_Notify_Service_Driver::shutdown (ACE_ENV_SINGLE_ARG_DECL)
// shutdown the ORB.
if (!CORBA::is_nil (this->orb_.in ()))
this->orb_->shutdown ();
+
+ /// Release all the _vars as the ORB is gone now.
+ notify_factory_._retn ();
+ orb_._retn ();
+ poa_._retn ();
+ naming_._retn ();
}
int
@@ -318,6 +355,30 @@ TAO_Notify_Service_Driver::parse_args (int &argc, ACE_TCHAR *argv[])
this->notify_factory_name_.set (ACE_TEXT_ALWAYS_CHAR(current_arg));
arg_shifter.consume_arg ();
}
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-UseSeparateDispatchingORB")) == 0)
+ {
+ current_arg = arg_shifter.get_the_parameter
+ (ACE_TEXT("-UseSeparateDispatchingORB"));
+ if (current_arg != 0 &&
+ (ACE_OS::strcmp(ACE_TEXT ("0"), current_arg) == 0 ||
+ ACE_OS::strcmp(ACE_TEXT ("1"), current_arg) == 0))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Using separate dispatching ORB\n")));
+ this->separate_dispatching_orb_ =
+ static_cast<bool> (ACE_OS::atoi(current_arg));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("WARNING: Unrecognized ")
+ ACE_TEXT ("argument (%s) to ")
+ ACE_TEXT ("-UseSeparateDispatchingORB.\n"),
+ (current_arg == 0 ? ACE_TEXT ("''") : current_arg)));
+ }
+ if (current_arg != 0)
+ arg_shifter.consume_arg ();
+ }
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-Boot")) == 0)
{
this->bootstrap_ = 1;
diff --git a/TAO/orbsvcs/Notify_Service/Notify_Service.h b/TAO/orbsvcs/Notify_Service/Notify_Service.h
index a32e6747b2a..ddf7203b146 100644
--- a/TAO/orbsvcs/Notify_Service/Notify_Service.h
+++ b/TAO/orbsvcs/Notify_Service/Notify_Service.h
@@ -90,6 +90,9 @@ protected:
int init_ORB (int& argc, ACE_TCHAR *argv []
ACE_ENV_ARG_DECL);
// initialize the ORB.
+ int init_dispatching_ORB (int& argc, ACE_TCHAR *argv []
+ ACE_ENV_ARG_DECL);
+ // initialize the dispatching ORB.
TAO_Notify_Service* notify_service_;
@@ -129,6 +132,9 @@ protected:
CORBA::ORB_var orb_;
// The ORB that we use.
+ CORBA::ORB_var dispatching_orb_;
+ // separate dispatching orb if needed.
+
PortableServer::POA_var poa_;
// Reference to the root poa.
@@ -140,6 +146,9 @@ protected:
int nthreads_;
// Number of worker threads.
+
+ bool separate_dispatching_orb_;
+ // indicate that a separate ORB is used for dispatching events.
};
#include /**/ "ace/post.h"
diff --git a/TAO/orbsvcs/Notify_Service/README b/TAO/orbsvcs/Notify_Service/README
index b83e208ac12..3dc06134774 100644
--- a/TAO/orbsvcs/Notify_Service/README
+++ b/TAO/orbsvcs/Notify_Service/README
@@ -46,9 +46,14 @@ Command line arguments:
Naming Service.
The default is "NotifyEventChannel".
-"-ORBRunThreads" : Number of threads to run the
+"-ORBRunThreads nthreads" : Number of threads to run the
ORB::run method.
+"-UseSeparateDispatchingORB 1|0"
+ : Indicates whether the service should create and
+ and use a separate ORB dedicated to dispatching of
+ events.
+
!! The -Notify_TPReactor option is deprecated!! use the -ORBRunThreads
option instead.
@@ -85,7 +90,7 @@ if you are using the "-NameSvc" options.
$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o naming.ior
- and the CosEvent_Service as
+ and the Notify_Service as
$ Notify_Service -ORBInitRef NameService=file://naming.ior
@@ -113,7 +118,8 @@ The svc.conf options:
The "Notify_Default_Event_Manager_Objects_Factory" service object accepts the following options:
-"-DispatchingThreads [thread_count]" : How many threads for MT dispatching.
+"-DispatchingThreads [thread_count]" : Enables MT dispatching with the specified number
+ of threads.
"-ListenerThreads" : How many threads for listener filter evaluation.
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp
index 8048c1dcaa5..920eb001c33 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp
@@ -7,6 +7,8 @@ ACE_RCSID (Notify,
"$Id$")
#include "ace/Bound_Ptr.h"
+#include "tao/Stub.h" // For debug messages printing out ORBid.
+#include "tao/ORB_Core.h"
#include "orbsvcs/CosEventCommC.h"
#include "orbsvcs/Notify/Event.h"
#include "orbsvcs/Notify/Properties.h"
@@ -35,14 +37,60 @@ TAO_Notify_PushConsumer::init (CosEventComm::PushConsumer_ptr push_consumer
ACE_THROW (CORBA::BAD_PARAM());
}
- this->push_consumer_ = CosEventComm::PushConsumer::_duplicate (push_consumer);
-
ACE_TRY
+ {
+ if (!TAO_Notify_PROPERTIES::instance()->separate_dispatching_orb ())
+ {
+ this->push_consumer_ = CosEventComm::PushConsumer::_duplicate (push_consumer);
+
+ this->publish_ =
+ CosNotifyComm::NotifyPublish::_narrow (push_consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ // "Port" consumer's object reference from receiving ORB to dispatching ORB.
+ CORBA::String_var temp =
+ TAO_Notify_PROPERTIES::instance()->orb()->object_to_string(push_consumer);
+
+ CORBA::Object_var obj =
+ TAO_Notify_PROPERTIES::instance()->dispatching_orb()->string_to_object(temp.in());
+
+ CosEventComm::PushConsumer_var new_cos_comm_pc =
+ CosEventComm::PushConsumer::_unchecked_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->push_consumer_ =
+ CosEventComm::PushConsumer::_duplicate (new_cos_comm_pc.in());
+
+ //
+ // Note that here we do an _unchecked_narrow() in order to avoid
+ // making a call on the consumer b/c the consumer may not have activated
+ // its POA just yet. That means that before we use this reference the first
+ // time, we'll actually need to call _is_a() on it, i.e., the equivalent
+ // of an _narrow(). At the time of this writing, the only use of
+ // this->publish_ is in TAO_NS_Consumer::dispatch_updates_i (the superclass).
+ // If any other use is made of this data member, then the code to validate
+ // the actual type of the target object must be refactored.
+ this->publish_ =
+ CosNotifyComm::NotifyPublish::_unchecked_narrow (obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ //--cj verify dispatching ORB
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Any push init dispatching ORB id is %s.\n",
+ obj->_stubobj()->orb_core()->orbid()));
+ }
+ //--cj end
+ }
+ }
+ ACE_CATCH (CORBA::TRANSIENT, ex)
{
- this->publish_ =
- CosNotifyComm::NotifyPublish::_narrow (push_consumer
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ ACE_PRINT_EXCEPTION (ex, "Got a TRANSIENT in NS_PushConsumer::init");
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) got it for NS_PushConsumer %@\n", this));
}
ACE_CATCHANY
{
@@ -61,6 +109,13 @@ TAO_Notify_PushConsumer::release (void)
void
TAO_Notify_PushConsumer::push (const CORBA::Any& payload ACE_ENV_ARG_DECL)
{
+ //--cj verify dispatching ORB
+ if (TAO_debug_level >= 10) {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Any push dispatching ORB id is %s.\n",
+ this->push_consumer_->_stubobj()->orb_core()->orbid()));
+ }
+ //--cj end
+
this->push_consumer_->push (payload ACE_ENV_ARG_PARAMETER);
}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp
index 7b19b418ebc..96a7d9ef8a7 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp
@@ -31,6 +31,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_Notify_Consumer::TAO_Notify_Consumer (TAO_Notify_ProxySupplier* proxy)
: proxy_ (proxy)
, is_suspended_ (0)
+, have_not_yet_verified_publish_ (true)
, pacing_ (proxy->qos_properties_.pacing_interval ())
, max_batch_size_ (CosNotification::MaximumBatchSize, 0)
, timer_id_ (-1)
@@ -683,7 +684,14 @@ void
TAO_Notify_Consumer::dispatch_updates_i (const CosNotification::EventTypeSeq& added, const CosNotification::EventTypeSeq& removed
ACE_ENV_ARG_DECL)
{
- if (!CORBA::is_nil (this->publish_.in ()))
+ if (this->have_not_yet_verified_publish_)
+ {
+ this->have_not_yet_verified_publish_ = false; // no need to check again
+ if (! this->publish_->_is_a ("IDL:omg.org/CosNotifyComm/NotifyPublish:1.0"
+ ACE_ENV_ARG_PARAMETER))
+ this->publish_ = CosNotifyComm::NotifyPublish::_nil();
+ }
+ if (! CORBA::is_nil (this->publish_.in ()))
this->publish_->offer_change (added, removed ACE_ENV_ARG_PARAMETER);
}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.h b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h
index 43b591b51e4..89058b6492e 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Consumer.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h
@@ -165,6 +165,7 @@ protected:
/// Interface that accepts offer_changes
CosNotifyComm::NotifyPublish_var publish_;
+ bool have_not_yet_verified_publish_;
/// The Pacing Interval
const TAO_Notify_Property_Time & pacing_;
diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp
index 2128c1852a4..3e095e32f73 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp
@@ -110,6 +110,30 @@ TAO_CosNotify_Service::init (int argc, ACE_TCHAR *argv[])
task_per_proxy = 1;
arg_shifter.consume_arg ();
}
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-UseSeparateDispatchingORB")) == 0)
+ {
+ current_arg = arg_shifter.get_the_parameter
+ (ACE_TEXT("-UseSeparateDispatchingORB"));
+ if (current_arg != 0 &&
+ (ACE_OS::strcmp(ACE_TEXT ("0"), current_arg) == 0 ||
+ ACE_OS::strcmp(ACE_TEXT ("1"), current_arg) == 0))
+ {
+ properties->separate_dispatching_orb (
+ static_cast<bool> (ACE_OS::atoi(current_arg)));
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Using separate Dispatching ORB\n")));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) WARNING: Unrecognized ")
+ ACE_TEXT ("argument (%s). Ignoring invalid ")
+ ACE_TEXT ("-UseSeparateDispatchingORB usage.\n"),
+ (current_arg == 0 ? ACE_TEXT ("''") : current_arg)));
+ }
+ if (current_arg != 0)
+ arg_shifter.consume_arg ();
+ }
else if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-AllowReconnect")) == 0)
{
arg_shifter.consume_arg ();
@@ -198,7 +222,36 @@ TAO_CosNotify_Service::init_service (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
{
ACE_DEBUG ((LM_DEBUG, "Loading the Cos Notification Service...\n"));
- this->init_i (orb ACE_ENV_ARG_PARAMETER);
+ if (TAO_Notify_PROPERTIES::instance()->separate_dispatching_orb())
+ {
+ // got here by way of svc.conf. no second orb supplied so create one
+ if (NULL == TAO_Notify_PROPERTIES::instance()->dispatching_orb())
+ {
+ ACE_DEBUG ((LM_DEBUG, "No dispatching orb supplied. Creating default one.\n"));
+
+ int argc = 0;
+ char *argv0 = 0;
+ char **argv = &argv0; // ansi requires argv be null terminated.
+ CORBA::ORB_var dispatcher = CORBA::ORB_init (argc, argv,
+ "default_dispatcher" ACE_ENV_ARG_PARAMETER);
+ //ACE_CHECK_RETURN (-1);
+
+ TAO_Notify_PROPERTIES::instance()->dispatching_orb(dispatcher.in());
+ }
+
+ this->init_i2 (orb, TAO_Notify_PROPERTIES::instance()->dispatching_orb() ACE_ENV_ARG_PARAMETER);
+
+ }
+ else
+ {
+ this->init_i (orb ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void
+TAO_CosNotify_Service::init_service2 (CORBA::ORB_ptr orb, CORBA::ORB_ptr dispatching_orb ACE_ENV_ARG_DECL)
+{
+ this->init_i2 (orb, dispatching_orb ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
@@ -217,22 +270,57 @@ TAO_CosNotify_Service::init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
PortableServer::POA_var default_poa = PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- /// Set the properties
- TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
+ // Set the properties
+ TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
- properties->orb (orb);
- properties->default_poa (default_poa.in ());
+ properties->orb (orb);
+ properties->default_poa (default_poa.in ());
- // Init the factory
- this->factory_.reset (this->create_factory (ACE_ENV_SINGLE_ARG_PARAMETER));
- ACE_CHECK;
- ACE_ASSERT( this->factory_.get() != 0 );
- TAO_Notify_PROPERTIES::instance()->factory (this->factory_.get());
+ // Init the factory
+ this->factory_.reset (this->create_factory (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+ ACE_ASSERT( this->factory_.get() != 0 );
+ TAO_Notify_PROPERTIES::instance()->factory (this->factory_.get());
- this->builder_.reset (this->create_builder (ACE_ENV_SINGLE_ARG_PARAMETER));
- ACE_CHECK;
- ACE_ASSERT( this->builder_.get() != 0 );
- TAO_Notify_PROPERTIES::instance()->builder (this->builder_.get());
+ this->builder_.reset (this->create_builder (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+ ACE_ASSERT( this->builder_.get() != 0 );
+ TAO_Notify_PROPERTIES::instance()->builder (this->builder_.get());
+}
+
+void
+TAO_CosNotify_Service::init_i2 (CORBA::ORB_ptr orb, CORBA::ORB_ptr dispatching_orb ACE_ENV_ARG_DECL)
+{
+ // Obtain the Root POA
+ CORBA::Object_var object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (object.in ()))
+ ACE_ERROR ((LM_ERROR, " (%P|%t) Unable to resolve the RootPOA.\n"));
+
+ PortableServer::POA_var default_poa = PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Set the properties
+ TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
+
+ properties->orb (orb);
+ properties->dispatching_orb (dispatching_orb);
+ properties->separate_dispatching_orb (true);
+
+ properties->default_poa (default_poa.in ());
+
+ // Init the factory and builder
+ this->factory_.reset (this->create_factory (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+ ACE_ASSERT( this->factory_.get() != 0 );
+ TAO_Notify_PROPERTIES::instance()->factory (this->factory_.get());
+
+ this->builder_.reset (this->create_builder (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_CHECK;
+ ACE_ASSERT( this->builder_.get() != 0 );
+ TAO_Notify_PROPERTIES::instance()->builder (this->builder_.get());
}
TAO_Notify_Factory*
diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h
index cc91e77d372..c3e2e8ebd47 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h
@@ -51,6 +51,9 @@ public:
virtual int fini (void);
+ /// separate dispatching orb Init
+ virtual void init_service2 (CORBA::ORB_ptr orb, CORBA::ORB_ptr dispatching_orb ACE_ENV_ARG_DECL);
+
/// Create the Channel Factory.
virtual CosNotifyChannelAdmin::EventChannelFactory_ptr create (PortableServer::POA_ptr default_POA ACE_ENV_ARG_DECL);
@@ -60,6 +63,8 @@ public:
protected:
/// Init the data members
virtual void init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+ /// Init the data members separate dispatching orb
+ virtual void init_i2 (CORBA::ORB_ptr orb, CORBA::ORB_ptr dispatching_orb ACE_ENV_ARG_DECL);
private:
diff --git a/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp b/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp
index 0137934dd22..8d781c1929e 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/POA_Helper.cpp
@@ -87,7 +87,13 @@ TAO_Notify_POA_Helper::create_i (PortableServer::POA_ptr parent_poa, const char*
ACE_CHECK;
if (DEBUG_LEVEL > 0)
- ACE_DEBUG ((LM_DEBUG, "Created POA : %s\n", this->poa_->the_name ()));
+ {
+ CORBA::String_var the_name = this->poa_->the_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Created POA : %s\n", the_name.in ()));
+ }
+
/*
// Destroy the policies
for (CORBA::ULong index = 0; index < policy_list.length (); ++index)
@@ -134,7 +140,13 @@ TAO_Notify_POA_Helper::activate (PortableServer::Servant servant, CORBA::Long& i
id = this->id_factory_.id ();
if (DEBUG_LEVEL > 0)
- ACE_DEBUG ((LM_DEBUG, "Activating object with id = %d in POA : %s\n", id, this->poa_->the_name ()));
+ {
+ CORBA::String_var the_name = this->poa_->the_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_DEBUG ((LM_DEBUG, "Activating object with id = %d in POA : %s\n", id, the_name.in ()));
+ }
// Convert CORBA::Long to ObjectId
PortableServer::ObjectId_var oid =
@@ -154,7 +166,12 @@ CORBA::Object_ptr
TAO_Notify_POA_Helper::activate_with_id (PortableServer::Servant servant, CORBA::Long id ACE_ENV_ARG_DECL)
{
if (DEBUG_LEVEL > 0)
- ACE_DEBUG ((LM_DEBUG, "Activating object with existing id = %d in POA : %s\n", id, this->poa_->the_name ()));
+ {
+ CORBA::String_var the_name = this->poa_->the_name (
+ ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ ACE_DEBUG ((LM_DEBUG, "Activating object with existing id = %d in POA : %s\n", id, the_name.in ()));
+ }
this->id_factory_.set_last_used (id);
// Convert CORBA::Long to ObjectId
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp b/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp
index 798f24fb7f1..cf63ccb0be1 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp
@@ -17,8 +17,11 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_Notify_Properties::TAO_Notify_Properties (void)
: factory_ (0)
, builder_ (0)
+ , orb_(0)
+ , dispatching_orb_ (0)
, asynch_updates_ (0)
, allow_reconnect_ (false)
+ , separate_dispatching_orb_ (false)
, updates_ (1)
{
// In case no conf. file is specified, the EC will default to reactive concurrency.
@@ -37,8 +40,13 @@ TAO_Notify_Properties::~TAO_Notify_Properties ()
{
}
-#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
-template class TAO_Singleton<TAO_Notify_Properties, ACE_Thread_Mutex> *TAO_Singleton<TAO_Notify_Properties, ACE_Thread_Mutex>::singleton_;
-#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
+TAO_Notify_Properties *
+TAO_Notify_Properties::instance (void)
+{
+ // Hide the template instantiation to prevent multiple instances
+ // from being created.
+ return
+ TAO_Singleton<TAO_Notify_Properties, TAO_SYNCH_MUTEX>::instance ();
+}
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.h b/TAO/orbsvcs/orbsvcs/Notify/Properties.h
index 7ab3ec74637..98e38df5705 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Properties.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.h
@@ -46,6 +46,9 @@ public:
/// Destructor
~TAO_Notify_Properties ();
+ /// Return a singleton instance of this class.
+ static TAO_Notify_Properties * instance (void);
+
// = Property Accessors
TAO_Notify_Factory* factory (void);
void factory (TAO_Notify_Factory* factory);
@@ -55,6 +58,8 @@ public:
CORBA::ORB_ptr orb (void);
void orb (CORBA::ORB_ptr orb);
+ CORBA::ORB_ptr dispatching_orb (void);
+ void dispatching_orb (CORBA::ORB_ptr dispatching_orb);
PortableServer::POA_ptr default_poa (void);
void default_poa (PortableServer::POA_ptr default_poa);
@@ -68,6 +73,8 @@ public:
// Turn on/off update messages.
CORBA::Boolean updates (void);
void updates (CORBA::Boolean updates);
+ bool separate_dispatching_orb (void);
+ void separate_dispatching_orb (bool b);
// The QoS Property that must be applied to each newly created Event Channel
const CosNotification::QoSProperties& default_event_channel_qos_properties (void);
@@ -109,6 +116,9 @@ protected:
/// ORB
CORBA::ORB_var orb_;
+ /// dispatching orb
+ CORBA::ORB_var dispatching_orb_;
+
// POA
PortableServer::POA_var default_poa_;
@@ -118,6 +128,9 @@ protected:
/// True if clients can reconnect to proxies.
bool allow_reconnect_;
+ /// True is separate dispatching orb
+ bool separate_dispatching_orb_;
+
/// True if updates are enabled (default).
CORBA::Boolean updates_;
@@ -140,9 +153,10 @@ protected:
CosNotification::QoSProperties pc_qos_;
};
-TAO_NOTIFY_SERV_SINGLETON_DECLARE (TAO_Singleton, TAO_Notify_Properties, TAO_SYNCH_MUTEX)
-
-typedef TAO_Singleton<TAO_Notify_Properties, TAO_SYNCH_MUTEX> TAO_Notify_PROPERTIES;
+/**
+ * @todo Remove this legacy TAO_Notify_Properties typedef.
+ */
+typedef TAO_Notify_Properties TAO_Notify_PROPERTIES;
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.inl b/TAO/orbsvcs/orbsvcs/Notify/Properties.inl
index c53e7087f8e..e48c65afbed 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Properties.inl
+++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.inl
@@ -34,12 +34,24 @@ TAO_Notify_Properties::orb (void)
return CORBA::ORB::_duplicate (orb_.in ());
}
+ACE_INLINE CORBA::ORB_ptr
+TAO_Notify_Properties::dispatching_orb (void)
+{
+ return CORBA::ORB::_duplicate (dispatching_orb_.in ());
+}
+
ACE_INLINE void
TAO_Notify_Properties::orb (CORBA::ORB_ptr orb)
{
orb_ = CORBA::ORB::_duplicate (orb);
}
+ACE_INLINE void
+TAO_Notify_Properties::dispatching_orb (CORBA::ORB_ptr dispatching_orb)
+{
+ dispatching_orb_ = CORBA::ORB::_duplicate (dispatching_orb);
+}
+
ACE_INLINE PortableServer::POA_ptr
TAO_Notify_Properties::default_poa (void)
{
@@ -76,6 +88,18 @@ TAO_Notify_Properties::allow_reconnect (bool b)
this->allow_reconnect_ = b;
}
+ACE_INLINE bool
+TAO_Notify_Properties::separate_dispatching_orb (void)
+{
+ return this->separate_dispatching_orb_;
+}
+
+ACE_INLINE void
+TAO_Notify_Properties::separate_dispatching_orb (bool b)
+{
+ this->separate_dispatching_orb_ = b;
+}
+
ACE_INLINE CORBA::Boolean
TAO_Notify_Properties::updates (void)
{
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.cpp b/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.cpp
index 6a5aff084e8..20131d3e299 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.cpp
@@ -1,5 +1,6 @@
// $Id$
+#include "tao/TAO_Singleton.h"
#include "orbsvcs/Notify/RT_Properties.h"
#if ! defined (__ACE_INLINE__)
@@ -19,4 +20,14 @@ TAO_Notify_RT_Properties::~TAO_Notify_RT_Properties ()
{
}
+TAO_Notify_RT_Properties *
+TAO_Notify_RT_Properties::instance (void)
+{
+ // Hide the template instantiation to prevent multiple instances
+ // from being created.
+
+ return
+ TAO_Singleton<TAO_Notify_RT_Properties, TAO_SYNCH_MUTEX>::instance ();
+}
+
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.h b/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.h
index 124f8757145..0dadf2b1533 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Properties.h
@@ -18,7 +18,6 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "tao/TAO_Singleton.h"
#include "tao/RTCORBA/RTCORBA.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -31,14 +30,14 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
*/
class TAO_RT_Notify_Export TAO_Notify_RT_Properties
{
- friend class TAO_Singleton<TAO_Notify_RT_Properties, TAO_SYNCH_MUTEX>;
-
public:
/// Constuctor
TAO_Notify_RT_Properties (void);
/// Destructor
~TAO_Notify_RT_Properties ();
+ /// Return singleton instance of this class.
+ static TAO_Notify_RT_Properties * instance (void);
RTCORBA::RTORB_ptr rt_orb (void);
void rt_orb (RTCORBA::RTORB_ptr rt_orb);
@@ -54,9 +53,10 @@ protected:
RTCORBA::Current_var current_;
};
-TAO_RT_NOTIFY_SINGLETON_DECLARE (TAO_Singleton, TAO_Notify_RT_Properties, TAO_SYNCH_MUTEX)
-
-typedef TAO_Singleton<TAO_Notify_RT_Properties, TAO_SYNCH_MUTEX> TAO_Notify_RT_PROPERTIES;
+/**
+ * @todo Remove this legacy TAO_Notify_RT_Properties typedef.
+ */
+typedef TAO_Notify_RT_Properties TAO_Notify_RT_PROPERTIES;
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp
index 19f972cd0cc..bf90caafbd2 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp
@@ -6,6 +6,8 @@ ACE_RCSID (Notify, TAO_Notify_SequencePushConsumer, "$Id$")
#include "ace/Reactor.h"
#include "tao/debug.h"
+#include "tao/Stub.h" // For debug messages printing out ORBid.
+#include "tao/ORB_Core.h"
#include "orbsvcs/Notify/QoSProperties.h"
#include "orbsvcs/Notify/ProxySupplier.h"
#include "orbsvcs/Notify/Worker_Task.h"
@@ -42,8 +44,49 @@ TAO_Notify_SequencePushConsumer::init (CosNotifyComm::SequencePushConsumer_ptr p
ACE_THROW (CORBA::BAD_PARAM());
}
- this->push_consumer_ = CosNotifyComm::SequencePushConsumer::_duplicate (push_consumer);
- this->publish_ = CosNotifyComm::NotifyPublish::_duplicate (push_consumer);
+ if (!TAO_Notify_PROPERTIES::instance()->separate_dispatching_orb ())
+ {
+ this->push_consumer_ = CosNotifyComm::SequencePushConsumer::_duplicate (push_consumer);
+ this->publish_ = CosNotifyComm::NotifyPublish::_duplicate (push_consumer);
+ }
+ else
+ {
+ // "Port" consumer's object reference from receiving ORB to dispatching ORB.
+ CORBA::String_var temp =
+ TAO_Notify_PROPERTIES::instance()->orb()->object_to_string(push_consumer);
+
+ CORBA::Object_var obj =
+ TAO_Notify_PROPERTIES::instance()->dispatching_orb()->string_to_object(temp.in());
+
+ ACE_TRY
+ {
+ CosNotifyComm::SequencePushConsumer_var new_push_consumer =
+ CosNotifyComm::SequencePushConsumer::_unchecked_narrow(obj.in());
+ ACE_TRY_CHECK;
+
+ this->push_consumer_ = CosNotifyComm::SequencePushConsumer::_duplicate (new_push_consumer);
+ this->publish_ = CosNotifyComm::NotifyPublish::_duplicate (new_push_consumer);
+
+ //--cj verify dispatching ORB
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Sequence push init dispatching ORB id is %s.\n",
+ obj->_stubobj()->orb_core()->orbid()));
+ }
+ //--cj end
+ }
+ ACE_CATCH (CORBA::TRANSIENT, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, "Got a TRANSIENT in NS_SequencePushConsumer::init");
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) got it for NS_SequencePushConsumer %@\n", this));
+ }
+ ACE_CATCHANY
+ {
+ // _narrow failed
+ }
+ ACE_ENDTRY;
+ }
}
void
@@ -259,6 +302,13 @@ TAO_Notify_SequencePushConsumer::push (const CosNotification::StructuredEvent& /
void
TAO_Notify_SequencePushConsumer::push (const CosNotification::EventBatch& event_batch ACE_ENV_ARG_DECL)
{
+ //--cj verify dispatching ORB
+ if (TAO_debug_level >= 10) {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Sequence push dispatching ORB id is %s.\n",
+ this->push_consumer_->_stubobj()->orb_core()->orbid()));
+ }
+ //--cj end
+
this->push_consumer_->push_structured_events (event_batch ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Service.h b/TAO/orbsvcs/orbsvcs/Notify/Service.h
index 6fdfd47f2ab..2876d6b16d9 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Service.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Service.h
@@ -64,6 +64,9 @@ public:
/// Init the service.
virtual void init_service (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) = 0;
+ /// Init the service with separate dispatching orb.
+ virtual void init_service2 (CORBA::ORB_ptr orb, CORBA::ORB_ptr dispatching_orb ACE_ENV_ARG_DECL) = 0;
+
/// Create the Channel Factory.
virtual CosNotifyChannelAdmin::EventChannelFactory_ptr create (
PortableServer::POA_ptr default_POA ACE_ENV_ARG_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp
index feb1b56c29c..7739b12b707 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp
@@ -3,9 +3,11 @@
ACE_RCSID(RT_Notify, TAO_Notify_StructuredPushConsumer, "$Id$")
+#include "ace/Bound_Ptr.h"
+#include "tao/Stub.h" // For debug messages printing out ORBid.
+#include "tao/ORB_Core.h"
#include "orbsvcs/Notify/Properties.h"
#include "orbsvcs/Notify/Event.h"
-#include "ace/Bound_Ptr.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -29,10 +31,48 @@ TAO_Notify_StructuredPushConsumer::init (CosNotifyComm::StructuredPushConsumer_p
ACE_THROW (CORBA::BAD_PARAM());
}
- this->push_consumer_ = CosNotifyComm::StructuredPushConsumer::_duplicate (push_consumer);
-
- this->publish_ = CosNotifyComm::NotifyPublish::_duplicate (push_consumer);
-
+ if (!TAO_Notify_PROPERTIES::instance()->separate_dispatching_orb ())
+ {
+ this->push_consumer_ = CosNotifyComm::StructuredPushConsumer::_duplicate (push_consumer);
+ this->publish_ = CosNotifyComm::NotifyPublish::_duplicate (push_consumer);
+ }
+ else
+ {
+ // "Port" consumer's object reference from receiving ORB to dispatching ORB.
+ CORBA::String_var temp =
+ TAO_Notify_PROPERTIES::instance()->orb()->object_to_string(push_consumer);
+
+ CORBA::Object_var obj =
+ TAO_Notify_PROPERTIES::instance()->dispatching_orb()->string_to_object(temp.in());
+
+ ACE_TRY
+ {
+ CosNotifyComm::StructuredPushConsumer_var new_push_consumer =
+ CosNotifyComm::StructuredPushConsumer::_unchecked_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->push_consumer_ = CosNotifyComm::StructuredPushConsumer::_duplicate (new_push_consumer.in());
+ this->publish_ = CosNotifyComm::NotifyPublish::_duplicate (new_push_consumer.in());
+ //--cj verify dispatching ORB
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Structured push init dispatching ORB id is %s.\n",
+ obj->_stubobj()->orb_core()->orbid()));
+ }
+ //--cj end
+ }
+ ACE_CATCH (CORBA::TRANSIENT, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, "Got a TRANSIENT in NS_StructuredPushConsumer::init");
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) got it for NS_StructuredPushConsumer %@\n", this));
+ }
+ ACE_CATCHANY
+ {
+ // _narrow failed
+ }
+ ACE_ENDTRY;
+ }
}
void
@@ -55,7 +95,15 @@ TAO_Notify_StructuredPushConsumer::push (const CORBA::Any& event ACE_ENV_ARG_DEC
void
TAO_Notify_StructuredPushConsumer::push (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL)
{
+ //--cj verify dispatching ORB
+ if (TAO_debug_level >= 10) {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Structured push dispatching ORB id is %s.\n",
+ this->push_consumer_->_stubobj()->orb_core()->orbid()));
+ }
+ //--cj end
+
this->push_consumer_->push_structured_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
}
/// Push a batch of events to this consumer.
diff --git a/TAO/orbsvcs/tests/Bug_1393_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1393_Regression/run_test.pl
index 816c0a4a17c..35d59ec917d 100755
--- a/TAO/orbsvcs/tests/Bug_1393_Regression/run_test.pl
+++ b/TAO/orbsvcs/tests/Bug_1393_Regression/run_test.pl
@@ -14,10 +14,10 @@ $status = 0;
$ifr_service_bin = "../../IFR_Service";
# The location of the tao_ifr utility binary
-$tao_ifr_bin = "../../../../bin";
+$tao_ifr_bin = "$ENV{ACE_ROOT}/bin";
# The location of the tao_idl utility binary
-$tao_idl_bin = "../../../../bin";
+$tao_idl_bin = "$ENV{ACE_ROOT}/bin";
# The idl file to be used for the test
$test_idl = PerlACE::LocalFile("test.idl");
diff --git a/TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl
index 63326050bb0..bd4bc793631 100755
--- a/TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl
+++ b/TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl
@@ -12,7 +12,7 @@ use PerlACE::Run_Test;
$imr_bin_path = "../../ImplRepo_Service";
# The location of the tao_imr IMR utility
-$tao_imr_bin_path = "../../../../bin";
+$tao_imr_bin_path = "$ENV{ACE_ROOT}/bin";
# IOR file names
$imr_ior_file = PerlACE::LocalFile("impl.ior");
diff --git a/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl
index ee52cfe9ca6..0df86c0cb02 100755
--- a/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl
+++ b/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl
@@ -12,7 +12,7 @@ use PerlACE::Run_Test;
$ifr_bin_path = "../../IFR_Service";
# The location of the tao_ifr IFR utility
-$tao_ifr_bin_path = "../../../../bin";
+$tao_ifr_bin_path = "$ENV{ACE_ROOT}/bin";
# IOR file names
$ifr_ior_file = PerlACE::LocalFile("ifr.ior");
diff --git a/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl
index 26ad7d45ff4..d3818dd8ef7 100755
--- a/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl
+++ b/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl
@@ -12,7 +12,7 @@ use PerlACE::Run_Test;
$imr_bin_path = "../../ImplRepo_Service";
# The location of the tao_imr IMR utility
-$tao_imr_bin_path = "../../../../bin";
+$tao_imr_bin_path = "$ENV{ACE_ROOT}/bin";
# IOR file names
$imr_ior_file = PerlACE::LocalFile("impl.ior");
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_2615_Regression/run_test.pl
index b72036a4a05..948f976ce02 100755
--- a/TAO/orbsvcs/tests/Bug_2615_Regression/run_test.pl
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/run_test.pl
@@ -5,7 +5,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# $Id$
# -*- perl -*-
-use lib '../../../../bin';
+use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
$status = 0;
diff --git a/TAO/orbsvcs/tests/Event/Performance/run_test.pl b/TAO/orbsvcs/tests/Event/Performance/run_test.pl
index bde6790200e..6fcee9bdecd 100755
--- a/TAO/orbsvcs/tests/Event/Performance/run_test.pl
+++ b/TAO/orbsvcs/tests/Event/Performance/run_test.pl
@@ -8,7 +8,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# This is a Perl script that runs the client and all the other servers that
# are needed
-use lib '../../../../../bin';
+use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
$status = 0;
diff --git a/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl
index 827a33cd317..b9b1ec65089 100755
--- a/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl
+++ b/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl
@@ -18,7 +18,7 @@ $activator_ior = PerlACE::LocalFile("activator.ior");
$IMR = new PerlACE::Process ("../../../ImplRepo_Service/ImplRepo_Service");
$ACTIVATOR = new PerlACE::Process("../../../ImplRepo_Service/ImR_Activator");
$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service");
-$TAO_IMR = new PerlACE::Process ("../../../../../bin/tao_imr");
+$TAO_IMR = new PerlACE::Process ("$ENV{ACE_ROOT}/bin/tao_imr");
# We want the tao_imr executable to be found exactly in the path
# given, without being modified by the value of -ExeSubDir.
diff --git a/TAO/orbsvcs/tests/ImplRepo/locked/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/locked/run_test.pl
index a2f9847b70a..629083b74d9 100755
--- a/TAO/orbsvcs/tests/ImplRepo/locked/run_test.pl
+++ b/TAO/orbsvcs/tests/ImplRepo/locked/run_test.pl
@@ -15,7 +15,7 @@ $imr_locator_ior = PerlACE::LocalFile ("imr_locator.ior");
$pfile = PerlACE::LocalFile ("persistence.dat");
$IMR_LOCATOR = new PerlACE::Process ("../../../ImplRepo_Service/ImplRepo_Service");
-$TAO_IMR = new PerlACE::Process ("../../../../../bin/tao_imr");
+$TAO_IMR = new PerlACE::Process ("$ENV{ACE_ROOT}/bin/tao_imr");
# We want the tao_imr executable to be found exactly in the path
# given, without being modified by the value of -ExeSubDir.
diff --git a/TAO/orbsvcs/tests/ImplRepo/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/run_test.pl
index c46832b5901..532f878adbe 100755
--- a/TAO/orbsvcs/tests/ImplRepo/run_test.pl
+++ b/TAO/orbsvcs/tests/ImplRepo/run_test.pl
@@ -45,7 +45,7 @@ my $endpoint = "-ORBEndpoint " . "$protocol" . "://:" . $port;
my $IMR_LOCATOR = new PerlACE::Process ("../../ImplRepo_Service/ImplRepo_Service");
my $IMR_ACTIVATOR = new PerlACE::Process ("../../ImplRepo_Service/ImR_Activator");
-my $TAO_IMR = new PerlACE::Process("../../../../bin/tao_imr");
+my $TAO_IMR = new PerlACE::Process("$ENV{ACE_ROOT}/bin/tao_imr");
# We want the tao_imr executable to be found exactly in the path
# given, without being modified by the value of -ExeSubDir.
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl
index 5ff9f8d336c..8586a721088 100755
--- a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl
@@ -26,7 +26,7 @@ for ($i = 0; $i <= $#ARGV; $i++) {
}
}
-$TAO_IFR = new PerlACE::Process ("../../../../../bin/tao_ifr");
+$TAO_IFR = new PerlACE::Process ("$ENV{ACE_ROOT}/bin/tao_ifr");
# We want the tao_ifr executable to be found exactly in the path
# given, without being modified by the value of -ExeSubDir.
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl
index 66d4c91ce83..c346b86e657 100755
--- a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl
@@ -60,7 +60,7 @@ my $CL = new PerlACE::Process ("IFR_Inheritance_Test",
my $tao_ifr = "undefined";
if ($^O eq "MSWin32")
{
- $tao_ifr = "../../../../../bin/tao_ifr";
+ $tao_ifr = "$ENV{ACE_ROOT}/bin/tao_ifr";
}
else
{
diff --git a/TAO/orbsvcs/tests/Notify/Basic/run_test.pl b/TAO/orbsvcs/tests/Notify/Basic/run_test.pl
index 23c71d27f1a..18fccbc0466 100755
--- a/TAO/orbsvcs/tests/Notify/Basic/run_test.pl
+++ b/TAO/orbsvcs/tests/Notify/Basic/run_test.pl
@@ -91,11 +91,15 @@ if (PerlACE::waitforfile_timed ($namingior, $startup_timeout) == -1) {
exit 1;
}
+for $dispatch_opt ("", "-UseSeparateDispatchingOrb 1")
+{
+
for $config (@test_configs)
{
print STDERR "\nTesting Notification Service with config file = $config ....\n\n";
$Notification = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
+ ' '.$dispatch_opt.' '.
"-ORBInitRef NameService=file://$namingior " .
"-IORoutput $notifyior " .
"-ORBSvcConf $config");
@@ -143,6 +147,7 @@ for $config (@test_configs)
$Notification->Kill ();
}
+}
$Naming->Kill ();
diff --git a/TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl b/TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl
index 8a181a0712b..0a37bf4613b 100755
--- a/TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl
+++ b/TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl
@@ -87,11 +87,14 @@ if (PerlACE::waitforfile_timed ($namingior, $startup_timeout) == -1) {
exit 1;
}
+for $dispatch_opt ("", "-UseSeparateDispatchingOrb 1")
+{
for $config (@test_configs)
{
print STDERR "\nTesting Notification Service with config file = $config ....\n\n";
$Notification = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
+ ' '.$dispatch_opt.' '.
"-ORBInitRef NameService=file://$namingior " .
"-IORoutput $notifyior " .
"-ORBSvcConf $config " .
@@ -136,6 +139,7 @@ for $config (@test_configs)
$Notification->Kill ();
}
+}
$Naming->Kill ();
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/run_test.pl b/TAO/orbsvcs/tests/RTCosScheduling/run_test.pl
index 9fd147a6a20..282b74b3d6f 100755
--- a/TAO/orbsvcs/tests/RTCosScheduling/run_test.pl
+++ b/TAO/orbsvcs/tests/RTCosScheduling/run_test.pl
@@ -5,7 +5,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
# $Id$
-use lib '../../../../bin';
+use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
$status = 0;
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/run_test.pl b/TAO/orbsvcs/tests/Security/Big_Request/run_test.pl
index c2806f6c246..fad3ec69c72 100755
--- a/TAO/orbsvcs/tests/Security/Big_Request/run_test.pl
+++ b/TAO/orbsvcs/tests/Security/Big_Request/run_test.pl
@@ -5,7 +5,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
# $Id$
-use lib '../../../../../bin';
+use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
$status = 0;
diff --git a/TAO/orbsvcs/tests/Security/Callback/run_test.pl b/TAO/orbsvcs/tests/Security/Callback/run_test.pl
index 910425441aa..f7fe142a954 100755
--- a/TAO/orbsvcs/tests/Security/Callback/run_test.pl
+++ b/TAO/orbsvcs/tests/Security/Callback/run_test.pl
@@ -5,7 +5,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
# $Id$
-use lib '../../../../../bin';
+use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
$status = 0;
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl b/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl
index 313d10bcfee..5ad46953859 100755
--- a/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl
@@ -6,7 +6,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# $Id$
-use lib '../../../../../bin';
+use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
$status = 0;
diff --git a/TAO/tao/GIOP_Message_State.cpp b/TAO/tao/GIOP_Message_State.cpp
index 19f591b623c..55799ea5dcf 100644
--- a/TAO/tao/GIOP_Message_State.cpp
+++ b/TAO/tao/GIOP_Message_State.cpp
@@ -77,18 +77,21 @@ TAO_GIOP_Message_State::parse_message_header_i (ACE_Message_Block &incoming)
if (this->message_size_ == 0)
{
- if (this->message_type_ == TAO_GIOP_MESSAGERROR)
+ switch (this->message_type_)
{
+ case TAO_GIOP_MESSAGERROR:
+ case TAO_GIOP_CLOSECONNECTION:
if (TAO_debug_level > 0)
{
+ CORBA::Octet& t = this->message_type_;
+ const char* which =
+ (t == TAO_GIOP_CLOSECONNECTION) ? "CloseConnection" :
+ (t == TAO_GIOP_MESSAGERROR) ? "MessageError" : "unknown";
ACE_DEBUG ((LM_DEBUG,
- "TAO (%P|%t) -"
- "GIOP_MESSAGE_ERROR received \n"));
+ "TAO (%P|%t) - GIOP %s received \n", which));
}
return 0;
- }
- else
- {
+ default:
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
"TAO (%P|%t) - "
diff --git a/TAO/tao/GIOP_Utils.h b/TAO/tao/GIOP_Utils.h
index dc471999831..50bb953f1c2 100644
--- a/TAO/tao/GIOP_Utils.h
+++ b/TAO/tao/GIOP_Utils.h
@@ -40,8 +40,8 @@ typedef enum GIOP_Messages
TAO_GIOP_CANCELREQUEST = 2, // by client.
TAO_GIOP_LOCATEREQUEST = 3, // by client.
TAO_GIOP_LOCATEREPLY = 4,
- TAO_GIOP_CLOSECONNECTION = 5,
- TAO_GIOP_MESSAGERROR = 6, // by both.
+ TAO_GIOP_CLOSECONNECTION = 5, // by both.
+ TAO_GIOP_MESSAGERROR = 6, // by both.
TAO_GIOP_FRAGMENT = 7 // by both.
} TAO_GIOP_Message_Type;
diff --git a/TAO/tao/ObjectKey_Table.cpp b/TAO/tao/ObjectKey_Table.cpp
index e3e52089e4a..38a851353de 100644
--- a/TAO/tao/ObjectKey_Table.cpp
+++ b/TAO/tao/ObjectKey_Table.cpp
@@ -11,32 +11,26 @@ ACE_RCSID(tao,
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-int
+bool
TAO::Less_Than_ObjectKey::operator () (const TAO::ObjectKey &lhs,
const TAO::ObjectKey &rhs) const
{
- if (lhs.length () < rhs.length ())
+ const CORBA::ULong rlen = rhs.length ();
+ const CORBA::ULong llen = lhs.length ();
+ if (llen < rlen)
{
return 1;
}
- else if (lhs.length () > rhs.length ())
+ else if (llen > rlen)
{
return 0;
}
- for (CORBA::ULong i = 0; i < rhs.length (); ++i)
- {
- if (lhs[i] < rhs[i])
- {
- return 1;
- }
- else if (lhs[i] > rhs[i])
- {
- return 0;
- }
- }
+ const CORBA::Octet * rhs_buff = rhs.get_buffer ();
+ const CORBA::Octet * lhs_buff = lhs.get_buffer ();
+ const bool result = (ACE_OS::memcmp (lhs_buff, rhs_buff, rlen) < 0);
- return 0;
+ return result;
}
/********************************************************/
@@ -92,7 +86,7 @@ TAO::ObjectKey_Table::bind (const TAO::ObjectKey &key,
key_new);
}
- key_new->incr_refcount ();
+ (void) key_new->incr_refcount ();
}
return retval;
diff --git a/TAO/tao/ObjectKey_Table.h b/TAO/tao/ObjectKey_Table.h
index 9deb1fbbd88..86a84a450ca 100644
--- a/TAO/tao/ObjectKey_Table.h
+++ b/TAO/tao/ObjectKey_Table.h
@@ -50,7 +50,7 @@ namespace TAO
class TAO_Export Less_Than_ObjectKey
{
public:
- int operator () (const TAO::ObjectKey &lhs,
+ bool operator () (const TAO::ObjectKey &lhs,
const TAO::ObjectKey &rhs) const;
};
diff --git a/TAO/tao/Unbounded_Octet_Sequence_T.h b/TAO/tao/Unbounded_Octet_Sequence_T.h
index 7941408f313..9d5235f2230 100644
--- a/TAO/tao/Unbounded_Octet_Sequence_T.h
+++ b/TAO/tao/Unbounded_Octet_Sequence_T.h
@@ -220,15 +220,11 @@ public:
return false;
}
- for (::CORBA::ULong i = 0; i < rlen; ++i)
- {
- if (rhs[i] != this->buffer_[i])
- {
- return false;
- }
- }
+ const CORBA::Octet * rhs_buff = rhs.get_buffer ();
+ const CORBA::Octet * lhs_buff = this->get_buffer ();
+ const bool result = (ACE_OS::memcmp (lhs_buff, rhs_buff, rlen) == 0);
- return true;
+ return result;
}
inline bool operator!= (const unbounded_value_sequence<CORBA::Octet> & rhs) const
@@ -342,15 +338,11 @@ operator== (const TAO_VERSIONED_NAMESPACE_NAME::TAO::unbounded_value_sequence<CO
return false;
}
- for (::CORBA::ULong i = 0; i < rlen; ++i)
- {
- if (rhs[i] != lhs[i])
- {
- return false;
- }
- }
+ const CORBA::Octet * rhs_buff = rhs.get_buffer ();
+ const CORBA::Octet * lhs_buff = lhs.get_buffer ();
+ const bool result = (ACE_OS::memcmp (lhs_buff, rhs_buff, rlen) == 0);
- return true;
+ return result;
}
inline
diff --git a/TAO/tests/Bug_2702_Regression/CloseConnection.mpc b/TAO/tests/Bug_2702_Regression/CloseConnection.mpc
new file mode 100644
index 00000000000..9ec64bd7118
--- /dev/null
+++ b/TAO/tests/Bug_2702_Regression/CloseConnection.mpc
@@ -0,0 +1,13 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Client): taoexe {
+ exename = client
+ idlflags += -GA
+
+ Source_Files {
+ TestC.cpp
+ client.cpp
+ }
+}
+
diff --git a/TAO/tests/Bug_2702_Regression/README b/TAO/tests/Bug_2702_Regression/README
new file mode 100644
index 00000000000..6418f2d4413
--- /dev/null
+++ b/TAO/tests/Bug_2702_Regression/README
@@ -0,0 +1,18 @@
+This test simulates the sending of a GIOP CloseConnection message.
+Since TAO does not send this GIOP message, a perl script
+(fakeserver2.pl) is used to simulate a CORBA server. Since it isn't
+really a CORBA server, it has no way to generate an IOR, and instead
+listens on a pre-selected fixed port (1192). Thus, part of this test
+includes an IOR for a server listening on endpoint
+iiop://127.0.0.1:1192.
+
+If the port number must be changed at some point in the future, one
+will have to generate a new IOR file as well. The original was
+generated using the "server" from the "Hello" test
+($ACE_ROOT/TAO/tests/Hello) with ORB arguments
+
+ -ORBDottedDecimalAddresses 1 -ORBendpoint iiop://127.0.0.1:1192
+
+Something similar could be used to re-generate.
+
+
diff --git a/TAO/tests/Bug_2702_Regression/Test.idl b/TAO/tests/Bug_2702_Regression/Test.idl
new file mode 100644
index 00000000000..3c0976e106d
--- /dev/null
+++ b/TAO/tests/Bug_2702_Regression/Test.idl
@@ -0,0 +1,20 @@
+//
+// $Id$
+//
+
+/// Put the interfaces in a module, to avoid global namespace pollution
+module Test
+{
+ /// A very simple interface
+ interface Hello
+ {
+ /// Return a simple string
+ string get_string ();
+
+ /// A method to shutdown the ORB
+ /**
+ * This method is used to simplify the test shutdown process
+ */
+ oneway void shutdown ();
+ };
+};
diff --git a/TAO/tests/Bug_2702_Regression/client.cpp b/TAO/tests/Bug_2702_Regression/client.cpp
new file mode 100644
index 00000000000..3b2d214029c
--- /dev/null
+++ b/TAO/tests/Bug_2702_Regression/client.cpp
@@ -0,0 +1,81 @@
+// $Id$
+
+#include "TestC.h"
+#include "ace/Get_Opt.h"
+
+ACE_RCSID(Hello, client, "$Id$")
+
+const char *ior = "file://test.ior";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var tmp =
+ orb->string_to_object(ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Hello_var hello =
+ Test::Hello::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (hello.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil Test::Hello reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ hello->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Time_Value duration(20, 0);
+ orb->run(duration);
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/tests/Bug_2702_Regression/closeconnection.dat b/TAO/tests/Bug_2702_Regression/closeconnection.dat
new file mode 100644
index 00000000000..478fbbc2fcd
--- /dev/null
+++ b/TAO/tests/Bug_2702_Regression/closeconnection.dat
Binary files differ
diff --git a/TAO/tests/Bug_2702_Regression/fakeserver.pm b/TAO/tests/Bug_2702_Regression/fakeserver.pm
new file mode 100644
index 00000000000..87f2a676f81
--- /dev/null
+++ b/TAO/tests/Bug_2702_Regression/fakeserver.pm
@@ -0,0 +1,151 @@
+package fakeserver;
+
+use Socket;
+use IO::Socket;
+
+sub new {
+ my $self = { };
+ $self->{'filebits'} = '';
+ $self->{'connections'} = { };
+ $self->{'server'} = '';
+ $self->{'server_fileno'} = '';
+ $self->{''} = '';
+}
+
+sub run {
+ my $self = shift;
+ my $timeoutafter = shift; # in seconds
+ my $rout;
+ while ( 1 ) {
+ print STDERR "fakeserver: Loop\n";
+
+ select( undef, undef, undef, 1 );
+
+ my ($n, $left) = select( $rout = $filebits, undef, undef, $timeoutafter); # Time out after 15 seconds
+ if ($n == 0) {
+ print STDERR "fakeserver: Terminating normally\n";
+ exit 0;
+ }
+
+ my $routs = unpack("b*", $rout);
+ print STDERR "fakeserver: Select $routs\n";
+ my $pos = index( $routs,'1');
+ while ( $pos >= 0 ) {
+ $self->HandleFile( $pos );
+ $pos = index( $routs,'1', $pos+1);
+ }
+ }
+}
+
+sub CloseServer {
+ my $self = shift;
+ vec($self->{'filebits'},$self->{'server_fileno'},1) = 0;
+ $server->close();
+ undef $server;
+}
+
+sub OpenServer {
+ my $self = shift;
+ my $server = IO::Socket::INET->new(Listen => 5,
+ LocalPort => 1192,
+ Reuse => 1,
+ ReuseAddr => 1,
+ Timeout => 0,
+ Proto => 'tcp');
+
+ die "Could not create socket $!" unless $server;
+
+ $server->blocking(0);
+ my $server_fileno = fileno($server);
+ vec($filebits,$server_fileno,1) = 1;
+
+ print STDERR "fakeserver: Starting $server_fileno\n";
+
+ open (DATA, 'closeconnection.dat') or die "couldn't open closeconnection.dat: $!\n";
+ my $n = read(DATA, $closeconnectionmessage, 100);
+ close(DATA);
+
+ print STDERR "fakeserver: read $n <$closeconnectionmessage> ", length($closeconnectionmessage), "\n";
+ $self->{'server'} = $server;
+ $self->{'server_fileno'} = $server_fileno;
+}
+
+sub SendMessage {
+ my $self = shift;
+ my( $message ) = @_;
+
+ print STDERR "fakeserver: SendMessage $message\n";
+ $message .= "\r\n";
+
+ foreach my $fileno (keys %{$self->{'connections'}}) {
+ if ( ${$self->{'connections'}}{$fileno} ) {
+ my $client = ${$self->{'connections'}}{$fileno}{client};
+ print $client $message;
+ }
+ }
+}
+
+sub HandleFile {
+ my $self = shift;
+ my ( $fileno ) = @_;
+
+ print STDERR "fakeserver: HandleFile $fileno\n";
+ if ( $fileno == $self->{'server_fileno'} ) {
+ HandleServer();
+ } elsif ( ${$self->{'connections'}}{$fileno} ) {
+ HandleClient( $fileno );
+ } else {
+ print STDERR "fakeserver: Weird fileno $fileno\n";
+ }
+}
+
+sub HandleServer {
+ my $self = shift;
+ my $client = $server->accept();
+
+ print STDERR "fakeserver: HandleServer\n";
+
+ if ( $client ) {
+ my $fileno = fileno($client);
+ $client->blocking(0);
+ ${$self->{'connections'}}{$fileno}{client} = $client;
+ ${$self->{'connections'}}{$fileno}{loggedin} = 0;
+ vec($self->{'filebits'},$fileno,1) = 1;
+ print STDERR "fakeserver: New client on $fileno\n";
+ } else {
+ print STDERR "fakeserver: No accept for server, reopen\n";
+ $self->CloseServer();
+ $self->OpenServer();
+ }
+}
+
+sub HandleClient {
+ my $self = shift;
+ my ( $fileno ) = @_;
+
+ print STDERR "fakeserver: HandleClient $fileno\n";
+ my $receive;
+ my $n = recv( ${$self->{'connections'}}{$fileno}{client}, $receive, 200, 0 );
+ my $rlen = length($receive);
+ if ( $receive ) {
+ if ($receive =~ /^GIOP/) {
+ print STDERR "fakeserver: Got $rlen byte GIOP message from client $fileno\n";
+ }
+ else {
+ print STDERR "fakeserver: Got $rlen bytes from client $fileno\n";
+ }
+ ${$self->{'connections'}}{$fileno}{receive} = $receive;
+ my $slen = length($closeconnectionmessage);
+ print STDERR "fakeserver: Sending $slen bytes GIOP closeconnection to $fileno\n";
+ sleep(3);
+ $n = send(${$self->{'connections'}}{$fileno}{client}, $closeconnectionmessage, 0);
+ print STDERR "fakeserver: Sent $n bytes GIOP closeconnection to $fileno\n";
+ } else {
+ print STDERR "fakeserver: Close client $fileno\n";
+ vec(${$self->{'filebits'}},$fileno,1) = 0;
+ ${$self->{'connections'}}{$fileno}{client}->close();
+ undef ${$self->{'connections'}}{$fileno};
+ $self->SendMessage( "Close Client" );
+ }
+}
+
diff --git a/TAO/tests/Bug_2702_Regression/fakeserver2.pl b/TAO/tests/Bug_2702_Regression/fakeserver2.pl
new file mode 100755
index 00000000000..4d6dbf61c60
--- /dev/null
+++ b/TAO/tests/Bug_2702_Regression/fakeserver2.pl
@@ -0,0 +1,138 @@
+#!/usr/bin/perl
+
+use Socket;
+use IO::Socket;
+
+$filebits = '';
+
+OpenServer();
+
+my $rout;
+while( 1 ) {
+ print STDERR "fakeserver: Loop\n";
+
+ select( undef, undef, undef, 1 );
+
+ ($n, $left) = select( $rout = $filebits, undef, undef, 15 ); # Time out after 15 seconds
+ if ($n == 0) {
+ print STDERR "fakeserver: Terminating normally\n";
+ exit 0;
+ }
+
+ my $routs = unpack("b*", $rout);
+ print STDERR "fakeserver: Select $routs\n";
+ my $pos = index( $routs,'1');
+ while ( $pos >= 0 ) {
+ HandleFile( $pos );
+ $pos = index( $routs,'1', $pos+1);
+ }
+}
+
+sub SendMessage {
+ local( $message ) = @_;
+
+ print STDERR "fakeserver: SendMessage $message\n";
+ $message .= "\r\n";
+
+ foreach $fileno (keys %connections) {
+ if ( $connections{$fileno} ) {
+ my $client = $connections{$fileno}{client};
+ print $client $message;
+ }
+ }
+}
+
+
+sub HandleFile {
+ local( $fileno ) = @_;
+
+ print STDERR "fakeserver: HandleFile $fileno\n";
+ if ( $fileno == $server_fileno ) {
+ HandleServer();
+ } elsif ( $connections{$fileno} ) {
+ HandleClient( $fileno );
+ } else {
+ print STDERR "fakeserver: Weird fileno $fileno\n";
+ }
+}
+
+sub HandleServer {
+ my $client = $server->accept();
+
+ print STDERR "fakeserver: HandleServer\n";
+
+ if ( $client ) {
+ my $fileno = fileno($client);
+ $client->blocking(0);
+ $connections{$fileno}{client} = $client;
+ $connections{$fileno}{loggedin} = 0;
+ vec($filebits,$fileno,1) = 1;
+# print $client "Welcome $fileno\r\n";
+# my $n = send($client, $closeconnectionmessage, 0);
+ print STDERR "fakeserver: New client on $fileno\n";
+# SendMessage( "New Client" );
+ } else {
+ print STDERR "fakeserver: No accept for server, reopen\n";
+ CloseServer();
+ OpenServer();
+ }
+}
+
+sub HandleClient {
+ local( $fileno ) = @_;
+
+ print STDERR "fakeserver: HandleClient $fileno\n";
+ $n = recv( $connections{$fileno}{client}, $receive, 200, 0 );
+ $rlen = length($receive);
+ if ( $receive ) {
+ if ($receive =~ /^GIOP/) {
+ print STDERR "fakeserver: Got $rlen byte GIOP message from client $fileno\n";
+ }
+ else {
+ print STDERR "fakeserver: Got $rlen bytes from client $fileno\n";
+ }
+ $connections{$fileno}{receive} = $receive;
+ $slen = length($closeconnectionmessage);
+ print STDERR "fakeserver: Sending $slen bytes GIOP closeconnection to $fileno\n";
+ sleep(3);
+ $n = send($connections{$fileno}{client}, $closeconnectionmessage, 0);
+ print STDERR "fakeserver: Sent $n bytes GIOP closeconnection to $fileno\n";
+ } else {
+ print STDERR "fakeserver: Close client $fileno\n";
+ vec($filebits,$fileno,1) = 0;
+ $connections{$fileno}{client}->close();
+ undef $connections{$fileno};
+ SendMessage( "Close Client" );
+ }
+
+}
+
+sub CloseServer {
+ vec($filebits,$server_fileno,1) = 0;
+ $server->close();
+ undef $server;
+}
+
+sub OpenServer {
+
+ $server = IO::Socket::INET->new(Listen => 5,
+ LocalPort => 1192,
+ Reuse => 1,
+ ReuseAddr => 1,
+ Timeout => 0,
+ Proto => 'tcp');
+
+ die "Could not create socket $!" unless $server;
+
+ $server->blocking(0);
+ $server_fileno = fileno($server);
+ vec($filebits,$server_fileno,1) = 1;
+
+ print STDERR "fakeserver: Starting $server_fileno\n";
+
+ open (DATA, 'closeconnection.dat') or die "couldn't open closeconnection.dat: $!\n";
+ my $n = read(DATA, $closeconnectionmessage, 100);
+ close(DATA);
+
+ print STDERR "fakeserver: read $n <$closeconnectionmessage> ", length($closeconnectionmessage), "\n";
+}
diff --git a/TAO/tests/Bug_2702_Regression/run_test.pl b/TAO/tests/Bug_2702_Regression/run_test.pl
new file mode 100755
index 00000000000..883eab373e3
--- /dev/null
+++ b/TAO/tests/Bug_2702_Regression/run_test.pl
@@ -0,0 +1,60 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::Run_Test;
+
+$iorfile = PerlACE::LocalFile ("server_on_localhost_1192.ior");
+$status = 0;
+
+## Get the perl interpreter that invoked us and remove any
+## executable extension (if there is one).
+my($perl) = $^X;
+$perl =~ s/\.exe$//i;
+
+$SV = new PerlACE::Process ($perl, "fakeserver2.pl");
+$CL = new PerlACE::Process ("client", " -k file://$iorfile -ORBdebuglevel 1 -ORBlogfile client.log");
+unlink "client.log";
+
+$SV->IgnoreExeSubDir(1);
+$SV->Spawn ();
+sleep(1); # give the server a chance to come up
+
+if (PerlACE::waitforfile_timed ($iorfile,
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (60);
+
+# We expect to have to kill both client and server.
+
+#if ($client != 0) {
+# print STDERR "ERROR: client returned $client\n";
+# $status = 1;
+#}
+
+$server = $SV->WaitKill (10);
+
+#if ($server != 0) {
+# print STDERR "ERROR: server returned $server\n";
+# $status = 1;
+#}
+
+open (LOG, "client.log") or die "Couldn't open client log file client.log: $!\n";
+while (<LOG>) {
+ $ccmsgfound = 1 if (/process_parsed_messages, received CloseConnection message/);
+}
+close (LOG);
+if (not $ccmsgfound) {
+ print STDERR "ERROR: didn't find CloseConnection debug message in client log.\n";
+ $status = 1;
+}
+
+exit $status;
diff --git a/TAO/tests/COIOP/run_test.pl b/TAO/tests/COIOP/run_test.pl
index e888f2cab33..98605585458 100755
--- a/TAO/tests/COIOP/run_test.pl
+++ b/TAO/tests/COIOP/run_test.pl
@@ -5,7 +5,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# $Id$
# -*- perl -*-
-use lib '../../../bin';
+use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
$iorfile = PerlACE::LocalFile ("test.ior");
diff --git a/TAO/tests/DLL_ORB/run_test.pl b/TAO/tests/DLL_ORB/run_test.pl
index e3b6539985a..6509c641b43 100755
--- a/TAO/tests/DLL_ORB/run_test.pl
+++ b/TAO/tests/DLL_ORB/run_test.pl
@@ -6,7 +6,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
#
# $Id$
-use lib '../../../bin';
+use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
$status = 0;
diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/run_test.pl b/TAO/tests/Portable_Interceptors/IORInterceptor/run_test.pl
index d6c417c48cb..88d843a1a96 100755
--- a/TAO/tests/Portable_Interceptors/IORInterceptor/run_test.pl
+++ b/TAO/tests/Portable_Interceptors/IORInterceptor/run_test.pl
@@ -5,7 +5,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
# $Id$
-use lib '../../../../bin';
+use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
$status = 0;
diff --git a/TAO/tests/Portable_Interceptors/PICurrent/run_test.pl b/TAO/tests/Portable_Interceptors/PICurrent/run_test.pl
index b4ab6bafa1d..64932b1e51d 100755
--- a/TAO/tests/Portable_Interceptors/PICurrent/run_test.pl
+++ b/TAO/tests/Portable_Interceptors/PICurrent/run_test.pl
@@ -5,7 +5,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
# $Id$
-use lib '../../../../bin';
+use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
$status = 0;
diff --git a/TAO/tests/Portable_Interceptors/PolicyFactory/run_test.pl b/TAO/tests/Portable_Interceptors/PolicyFactory/run_test.pl
index 58fa821c094..c82b4816ef0 100755
--- a/TAO/tests/Portable_Interceptors/PolicyFactory/run_test.pl
+++ b/TAO/tests/Portable_Interceptors/PolicyFactory/run_test.pl
@@ -6,7 +6,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
#
# $Id$
-use lib '../../../../bin';
+use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
$status = 0;
diff --git a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/run_test.pl b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/run_test.pl
index 162acd63c17..b81cef5bf37 100755
--- a/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/run_test.pl
+++ b/TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/run_test.pl
@@ -5,7 +5,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
# $Id$
-use lib '../../../../bin';
+use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
$status = 0;
diff --git a/TAO/utils/nslist/run_test.pl b/TAO/utils/nslist/run_test.pl
index 26c0297ce87..3ba82bb4616 100755
--- a/TAO/utils/nslist/run_test.pl
+++ b/TAO/utils/nslist/run_test.pl
@@ -19,8 +19,8 @@ use PerlACE::Run_Test;
my $iorfile = PerlACE::LocalFile ("ns.ior");
my $NS = new PerlACE::Process ("../../orbsvcs/Naming_Service/Naming_Service");
my $CL = new PerlACE::Process ("../../orbsvcs/tests/Simple_Naming/client");
-my $LS = new PerlACE::Process ("../../../bin/nslist");
-my $AD = new PerlACE::Process ("../../../bin/nsadd");
+my $LS = new PerlACE::Process ("$ENV{ACE_ROOT}/bin/nslist");
+my $AD = new PerlACE::Process ("$ENV{ACE_ROOT}/bin/nsadd");
my $status = 0;
# We want the nslist and nsadd executables to be found exactly in the path