示例#1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            Util.SetupLogging();

            StopSemaphore           = new Semaphore(0, 1);
            Console.CancelKeyPress += Stop;

            Config.LoadConfig();
            Management.ReadJobs();

            var lpdListener = new LpdListener();

            lpdListener.NewJobReceived += (sender, newJobInfo) => Management.AddJob(newJobInfo);
            lpdListener.Start();

            var httpListener = new HttpListenerResponder(Config.HttpListenPort);

            httpListener.Start();

            // wait
            StopSemaphore.WaitOne();

            httpListener.Stop();
            lpdListener.Stop();
        }
示例#2
0
 protected override void OnStop()
 {
     _lpdListener.Stop();
     _httpListener.Stop();
 }