コード例 #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);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: moov2/moov2-labs
        /// <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);
            }
        }
コード例 #3
0
 protected override void OnStop()
 {
     _webSocket.Stop();
 }