Example #1
0
        /// <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);
            }
        }
Example #2
0
        /// <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);
            }
        }
Example #3
0
 protected override void OnStart(string[] args)
 {
     _webSocket = new Labs.WebSocket.Service.WebSockets.WebSocket();
     _webSocket.Start(new DemoWebSocketHandler());
 }
Example #4
0
 protected override void OnStart(string[] args)
 {
     _webSocket = new Labs.WebSocket.Service.WebSockets.WebSocket();
     _webSocket.Start(new DemoWebSocketHandler());
 }