summaryrefslogtreecommitdiff
path: root/apps/Gateway/Gateway/gatewayd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'apps/Gateway/Gateway/gatewayd.cpp')
-rw-r--r--apps/Gateway/Gateway/gatewayd.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/apps/Gateway/Gateway/gatewayd.cpp b/apps/Gateway/Gateway/gatewayd.cpp
new file mode 100644
index 00000000000..5897c69ca00
--- /dev/null
+++ b/apps/Gateway/Gateway/gatewayd.cpp
@@ -0,0 +1,34 @@
+// Main driver program for the Gateway. This file is completely
+// @(#)gatewayd.cpp 1.1 10/18/96
+
+// 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 (ACE_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;
+}