diff options
-rw-r--r-- | TAO/tests/BiDirectional/client.cpp | 18 | ||||
-rw-r--r-- | TAO/tests/BiDirectional/server.cpp | 6 | ||||
-rw-r--r-- | TAO/tests/BiDirectional/test_i.cpp | 14 | ||||
-rw-r--r-- | TAO/tests/BiDirectional/test_i.h | 2 |
4 files changed, 23 insertions, 17 deletions
diff --git a/TAO/tests/BiDirectional/client.cpp b/TAO/tests/BiDirectional/client.cpp index 18d91db9090..50acc019605 100644 --- a/TAO/tests/BiDirectional/client.cpp +++ b/TAO/tests/BiDirectional/client.cpp @@ -6,12 +6,15 @@ ACE_RCSID(BiDirectional, client, "$Id$") const char *ior = "file://test.ior"; -int do_shutdown = 0; + +void do_nothing (void) +{ +} int parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "k:x"); + ACE_Get_Opt get_opts (argc, argv, "k:"); int c; while ((c = get_opts ()) != -1) @@ -20,15 +23,12 @@ parse_args (int argc, char *argv[]) case 'k': ior = get_opts.optarg; break; - case 'x': - do_shutdown = 1; - break; + case '?': default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s " "-k <ior> " - "-x <shutdown> " "\n", argv [0]), -1); @@ -138,11 +138,7 @@ main (int argc, char *argv[]) r)); } - if (do_shutdown) - { - server->shutdown (ACE_TRY_ENV); - ACE_TRY_CHECK; - } + orb->run (); root_poa->destroy (1, 1, ACE_TRY_ENV); ACE_TRY_CHECK; diff --git a/TAO/tests/BiDirectional/server.cpp b/TAO/tests/BiDirectional/server.cpp index 9a15c6bf0b3..fbd143f8e42 100644 --- a/TAO/tests/BiDirectional/server.cpp +++ b/TAO/tests/BiDirectional/server.cpp @@ -133,8 +133,8 @@ main (int argc, char *argv[]) ACE_OS::fclose (output_file); } - // Explicit Event Loop - while (1) + int retval = 0; + while (retval == 0) { // Please see the README file on why this is being done CORBA::Boolean pending = @@ -147,7 +147,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; } - server_impl.call_client (ACE_TRY_ENV); + retval = server_impl.call_client (ACE_TRY_ENV); ACE_TRY_CHECK; } ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); diff --git a/TAO/tests/BiDirectional/test_i.cpp b/TAO/tests/BiDirectional/test_i.cpp index 32be16d5d97..2792a1758f2 100644 --- a/TAO/tests/BiDirectional/test_i.cpp +++ b/TAO/tests/BiDirectional/test_i.cpp @@ -48,7 +48,7 @@ Simple_Server_i::callback_object (Callback_ptr callback, this->callback_ = Callback::_duplicate (callback); } -void +int Simple_Server_i::call_client (CORBA::Environment &ACE_TRY_ENV) { if (this->flag_) @@ -56,11 +56,21 @@ Simple_Server_i::call_client (CORBA::Environment &ACE_TRY_ENV) for (int times = 0; times < this->no_iterations_; ++times) { this->callback_->callback_method (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN (0); + + TAO_ORB_Core *orb_core = this->orb_->orb_core (); + if (orb_core->connection_cache ().total_size () > 1) + ACE_ASSERT (-1); } + this->callback_->shutdown (ACE_TRY_ENV); + ACE_CHECK_RETURN (0); this->flag_ = 0; + + return 1; } + + return 0; } diff --git a/TAO/tests/BiDirectional/test_i.h b/TAO/tests/BiDirectional/test_i.h index c83ab8719f6..607cfe86f88 100644 --- a/TAO/tests/BiDirectional/test_i.h +++ b/TAO/tests/BiDirectional/test_i.h @@ -68,7 +68,7 @@ public: void shutdown (CORBA::Environment&) ACE_THROW_SPEC ((CORBA::SystemException)); - void call_client (CORBA::Environment&); + int call_client (CORBA::Environment&); private: CORBA::ORB_var orb_; |