static void Main(string[] args) { var host = new ServiceHost(typeof(StockService)); host.Open(); var queueListener = new QueueListener(); queueListener.StartListening("request", true); Console.WriteLine("Press <Enter> to stop the services."); Console.ReadLine(); queueListener.Dispose(); host.Close(); }
protected override void OnStop() { _queueListener.Dispose(); _serviceHost.Close(); }
protected void Application_End() { _queueListener.Dispose(); }