2 //=============================================================================
6 * Driver for the peer daemon (peerd). Note that this is
7 * completely generic code due to the Service Configurator
10 * @author Douglas C. Schmidt
12 //=============================================================================
14 #include "ace/OS_NS_unistd.h"
18 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
20 if (ACE_OS::access (ACE_DEFAULT_SVC_CONF
, F_OK
) != 0)
22 // Use static linking.
23 ACE_Service_Object_Ptr sp
= ACE_SVC_INVOKE (Peer_Factory
);
25 if (sp
->init (argc
- 1, argv
+ 1) == -1)
26 ACE_ERROR_RETURN ((LM_ERROR
,
31 // Run forever, performing the configured services until we are
32 // shut down by a SIGINT/SIGQUIT signal.
34 ACE_Reactor::instance ()->run_reactor_event_loop ();
36 // Destructor of <ACE_Service_Object_Ptr> automagically call
41 if (ACE_Service_Config::open (argc
, argv
) == -1)
42 ACE_ERROR_RETURN ((LM_ERROR
,
46 else // Use dynamic linking.
48 // Run forever, performing the configured services until we
49 // are shut down by a signal (e.g., SIGINT or SIGQUIT).
51 ACE_Reactor::instance ()->run_reactor_event_loop ();