summaryrefslogtreecommitdiff
path: root/apps/JAWS/server/main.cpp
blob: 6929ecbe35a63137c6826592c17f9c4ad23f49b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// $Id$

#include "ace/Service_Config.h"
#include "HTTP_Server.h"

ACE_STATIC_SVC_REQUIRE(HTTP_Server)

extern "C"
{

  // call exit() so that static destructors get called 
static void
handler (int) 
{ 
  ACE_OS::exit (0); 
}

}

// This is the driver entry point into JAWS.  It is possible to use
// JAWS as an ACE Service, as well.

int
main (int argc, char *argv[])
{
  ACE_Service_Config daemon;
  ACE_Sig_Action sa ((ACE_SignalHandler) handler, SIGINT);
  ACE_OS::signal (SIGCHLD, SIG_IGN);
  ACE_UNUSED_ARG (sa);

  if (daemon.open (argc, argv) == -1)
    ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), 1);

  // Run forever, performing the configured services until we receive
  // a SIGINT.

  daemon.run_reactor_event_loop ();
  return 0;
}