diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-12-30 06:50:29 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-12-30 06:50:29 +0000 |
commit | a5c4d8047ab58df5c45092e18ae503ad40518f0e (patch) | |
tree | daa1ac46caf738dfe049fd5ca5eafc0eb84a0eb0 /apps/Gateway/Peer/peerd.cpp | |
parent | 645a9c1a4457349320e62d85af49f62e80da53c0 (diff) | |
download | ATCD-a5c4d8047ab58df5c45092e18ae503ad40518f0e.tar.gz |
foo
Diffstat (limited to 'apps/Gateway/Peer/peerd.cpp')
-rw-r--r-- | apps/Gateway/Peer/peerd.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/apps/Gateway/Peer/peerd.cpp b/apps/Gateway/Peer/peerd.cpp index 7836e9892f8..3b7bdb0cb2d 100644 --- a/apps/Gateway/Peer/peerd.cpp +++ b/apps/Gateway/Peer/peerd.cpp @@ -1,11 +1,10 @@ -/* Driver for the peer daemon (peerd). Note that this // $Id$ - is completely generic code due to the Service Configurator - framework! */ +// Driver for the peer daemon (peerd). Note that this is completely +// generic code due to the Service Configurator framework! #include "ace/Service_Config.h" -#include "Gateway_Handler.h" +#include "Peer.h" int main (int argc, char *argv[]) @@ -20,7 +19,7 @@ main (int argc, char *argv[]) { static char *l_argv[3] = { "-d", "-p", "10002" }; - ACE_Service_Object *so = _alloc_peerd (); + ACE_Service_Object *so = _make_Peer_Acceptor (); if (so->init (3, l_argv) == -1) @@ -28,7 +27,19 @@ main (int argc, char *argv[]) } } - /* Run forever, performing the configured services (until SIGINT/SIGQUIT occurs) */ + // Create an adapter to end the event loop. + ACE_Sig_Adapter sa ((ACE_Sig_Handler_Ex) ACE_Service_Config::end_reactor_event_loop); + + ACE_Sig_Set sig_set; + sig_set.sig_add (SIGINT); + sig_set.sig_add (SIGQUIT); + + // Register ourselves to receive SIGINT and SIGQUIT so we can shut + // down gracefully via signals. + ACE_Service_Config::reactor ()->register_handler (sig_set, &sa); + + // Run forever, performing the configured services until we are shut + // down by a SIGINT/SIGQUIT signal. daemon.run_reactor_event_loop (); |