summaryrefslogtreecommitdiff
path: root/apps/Gateway/Gateway/gatewayd.cpp
blob: 48b6e9a173dac6df1c435fda1788c3e6b64413b7 (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
// Main driver program for the Gateway.  This file is completely
// $Id$

// generic code due to the ACE Service Configurator framework!

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

int
main (int argc, char *argv[])
{
  ACE_Service_Config daemon;

  if (daemon.open (argc, argv) == -1)
    {
      if (errno != ENOENT)
	ACE_ERROR ((LM_ERROR, "%p\n%a", "open", 1));
      else // Use static binding.
	{
	  static char *l_argv[3] = { "-d" };
	  ACE_Service_Object *so = ACE_SVC_INVOKE (Gateway);

	  if (so->init (1, l_argv) == -1)
	    ACE_ERROR ((LM_ERROR, "%p\n%a", "init", 1));
	}
    }

  // Run forever, performing the configured services until we are shut
  // down by a signal.

  ACE_Service_Config::run_reactor_event_loop ();

  return 0;
}