/// <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(); }
protected override void OnStop() { _lpdListener.Stop(); _httpListener.Stop(); }