1 #include "ace/Service_Config.h"
2 #include "ace/Reactor.h"
3 #include "ace/Filecache.h"
5 #include "HTTP_Server.h"
6 #include "ace/OS_main.h"
7 #include "ace/OS_NS_signal.h"
9 ACE_STATIC_SVC_REQUIRE(HTTP_Server
)
11 #ifdef ACE_HAS_SIG_C_FUNC
14 #endif /* ACE_HAS_SIG_C_FUNC */
16 // call exit() so that static destructors get called
20 delete (ACE_Filecache
*) ACE_Filecache::instance ();
24 #ifdef ACE_HAS_SIG_C_FUNC
26 #endif /* ACE_HAS_SIG_C_FUNC */
28 // This is the driver entry point into JAWS. It is possible to use
29 // JAWS as an ACE Service, as well.
32 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
34 ACE_Service_Config daemon
;
36 ACE_OS::signal (SIGCHLD
, SIG_IGN
);
38 // SigAction not needed since the handler will shutdown the server.
39 ACE_OS::signal (SIGINT
, (ACE_SignalHandler
) handler
);
40 ACE_OS::signal (SIGUSR2
, (ACE_SignalHandler
) handler
);
42 if (daemon
.open (argc
, argv
, ACE_DEFAULT_LOGGER_KEY
, 0) != 0)
43 ACE_ERROR_RETURN ((LM_ERROR
, "%p\n", "open"), 1);
45 // The configured service creates threads, and the
46 // server won't exit until the threads die.
48 // Run forever, performing the configured services until we receive