Example #1
0
        public Service(FastAGIDaemon daemon)
        {
            this.CanShutdown = true;
            this.CanStop     = true;

            m_daemon = daemon;
        }
Example #2
0
        static void Main(string[] args)
        {
            try
            {
                FastAGIDaemon daemon = new FastAGIDaemon();

                if (args != null && args.Length == 1 && args[0].StartsWith("-c"))
                {
                    Console.WriteLine("FastAGI Server starting");

                    Thread daemonThread = new Thread(daemon.Start);
                    daemonThread.Start();

                    m_serviceUp.WaitOne();
                }
                else
                {
                    System.ServiceProcess.ServiceBase[] ServicesToRun;
                    ServicesToRun = new System.ServiceProcess.ServiceBase[] { new Service(daemon) };
                    System.ServiceProcess.ServiceBase.Run(ServicesToRun);
                }
            }
            catch (Exception excp)
            {
                Console.WriteLine("Exception Main. " + excp.Message);
            }
        }
Example #3
0
        public Service(FastAGIDaemon daemon)
		{
			this.CanShutdown = true;
			this.CanStop = true;

            m_daemon = daemon;
		}
        static void Main(string[] args)
        {
            try
            {
                FastAGIDaemon daemon = new FastAGIDaemon();

                if (args != null && args.Length == 1 && args[0].StartsWith("-c"))
                {
                    Console.WriteLine("FastAGI Server starting");

                    Thread daemonThread = new Thread(daemon.Start);
                    daemonThread.Start();

                    m_serviceUp.WaitOne();
                }
                else
                {
                    System.ServiceProcess.ServiceBase[] ServicesToRun;
                    ServicesToRun = new System.ServiceProcess.ServiceBase[] { new Service(daemon) };
                    System.ServiceProcess.ServiceBase.Run(ServicesToRun);
                }
            }
            catch (Exception excp)
            {
                Console.WriteLine("Exception Main. " + excp.Message);
            }
        }