/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { if (args.Length > 0 && args[0].ToLower() == "/console") { AllocConsole(); var webSocket = new Labs.WebSocket.Service.WebSockets.WebSocket(); webSocket.Start(new DemoWebSocketHandler()); string input = string.Empty; // Wait for the user to exit the application while (input.ToLower() != "exit") { input = Console.ReadLine(); } // Stop the application. webSocket.Stop(); } else { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new WebSocketService() }; ServiceBase.Run(ServicesToRun); } }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { if (args.Length > 0 && args[0].ToLower() == "/console") { AllocConsole(); var webSocket = new Labs.WebSocket.Service.WebSockets.WebSocket(); webSocket.Start(new DemoWebSocketHandler()); string input = string.Empty; // Wait for the user to exit the application while (input.ToLower() != "exit") input = Console.ReadLine(); // Stop the application. webSocket.Stop(); } else { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new WebSocketService() }; ServiceBase.Run(ServicesToRun); } }
protected override void OnStop() { _webSocket.Stop(); }