summaryrefslogtreecommitdiff
path: root/tests/Reactor_Exceptions_Test.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1998-08-26 02:09:26 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1998-08-26 02:09:26 +0000
commit4f6e220da23fccca3682ed3a194b01509e45493b (patch)
tree4e49d4a48de66970ab7463398539927c9cf07937 /tests/Reactor_Exceptions_Test.cpp
parentdfb3d14dc5512ab948511e4aa9713814768ea806 (diff)
downloadATCD-4f6e220da23fccca3682ed3a194b01509e45493b.tar.gz
*** empty log message ***
Diffstat (limited to 'tests/Reactor_Exceptions_Test.cpp')
-rw-r--r--tests/Reactor_Exceptions_Test.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/Reactor_Exceptions_Test.cpp b/tests/Reactor_Exceptions_Test.cpp
index 553e39a73fe..04080ccf19f 100644
--- a/tests/Reactor_Exceptions_Test.cpp
+++ b/tests/Reactor_Exceptions_Test.cpp
@@ -148,22 +148,24 @@ main (int argc, ASYS_TCHAR *argv[])
ACE_START_TEST (ASYS_TEXT ("Reactor_Exceptions_Test"));
#if defined (ACE_HAS_EXCEPTIONS)
- My_Reactor reactor;
-
- u_short port = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_SERVER_PORT;
-
ACE_DEBUG ((LM_DEBUG,
ASYS_TEXT ("Starting tracing\n")));
- ACE_Reactor::instance (&reactor);
- ACE_Thread_Manager *thr_mgr =
- ACE_Thread_Manager::instance ();
+ u_short port = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_SERVER_PORT;
ACE_INET_Addr local_addr (port);
ACE_INET_Addr remote_addr (port,
ACE_DEFAULT_SERVER_HOST);
+ // Put the <handler> before the <reactor> so that they'll be cleaned
+ // up in the proper order.
My_Handler handler (local_addr);
+ My_Reactor reactor;
+
+ ACE_Reactor::instance (&reactor);
+ ACE_Thread_Manager *thr_mgr =
+ ACE_Thread_Manager::instance ();
+
if (ACE_Reactor::instance ()->register_handler
(&handler,
ACE_Event_Handler::READ_MASK) == -1)
@@ -183,8 +185,9 @@ main (int argc, ASYS_TCHAR *argv[])
ACE_SOCK_Dgram dgram ((ACE_INET_Addr &) ACE_Addr::sap_any);
for (size_t i = 0; i < ACE_MAX_ITERATIONS; i++)
- dgram.send (ASYS_TEXT ("Hello"), sizeof (ASYS_TEXT ("Hello")), remote_addr);
-
+ dgram.send (ASYS_TEXT ("Hello"),
+ sizeof (ASYS_TEXT ("Hello")),
+ remote_addr);
// Barrier to wait for the other thread to return.
thr_mgr->wait ();