summaryrefslogtreecommitdiff
path: root/examples/Service_Configurator/IPC-tests/server
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-27 06:04:10 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-27 06:04:10 +0000
commitc08f68e92f2454a46ec91db97d776ad6304328bb (patch)
treea53c24ee44d6b4fb4c6bb2d8e3168b987eb9f08b /examples/Service_Configurator/IPC-tests/server
parent8d87d701900caa1f26567a5c639aa2c244fa1eeb (diff)
downloadATCD-c08f68e92f2454a46ec91db97d776ad6304328bb.tar.gz
foo
Diffstat (limited to 'examples/Service_Configurator/IPC-tests/server')
-rw-r--r--examples/Service_Configurator/IPC-tests/server/server_test.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/examples/Service_Configurator/IPC-tests/server/server_test.cpp b/examples/Service_Configurator/IPC-tests/server/server_test.cpp
index f65523d956d..451f178e256 100644
--- a/examples/Service_Configurator/IPC-tests/server/server_test.cpp
+++ b/examples/Service_Configurator/IPC-tests/server/server_test.cpp
@@ -1,31 +1,28 @@
-/* The main test driver for the dynamically configured server. */
// $Id$
+// The main test driver for the dynamically configured server.
#include "ace/Service_Config.h"
-sig_atomic_t finished = 0;
-
-static void
-handler (int)
-{
- finished = 1;
-}
-
int
main (int argc, char *argv[])
{
ACE_Service_Config server_test;
- ACE_Sig_Action sig ((ACE_SignalHandler) handler, SIGINT);
-
if (server_test.open (argc, argv) == -1)
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "server_test.open"), -1);
- for (;;)
- if (server_test.run_reactor_event_loop () == -1 && finished)
- break;
+ // Create an adapter to end the event loop.
+ ACE_Sig_Adapter sa (ACE_Sig_Handler_Ex (ACE_Service_Config::end_reactor_event_loop));
+
+ // Register a signal handler.
+ ACE_Service_Config::reactor ()->register_handler (SIGINT, sa);
+
+ // Run forever, performing the configured services until we are shut
+ // down by a SIGINT/SIGQUIT signal.
+
+ while (server_test.reactor_event_loop_done () == 0)
+ server_test.run_reactor_event_loop ();
- /* NOTREACHED */
return 0;
}