コード例 #1
0
ファイル: Program.cs プロジェクト: careysoft/SqlData
        static void Main(string[] args)
        {
            Console.WriteLine("Press wait to start the server!");
            AutoServer autoServer = new AutoServer();

            autoServer.EventReceiveThreadMessage += new Model.EventMessageHandler(EventReceiveThreadMessage);
            if (!autoServer.StartServer())
            {
                Console.WriteLine("The server started fail!");
                return;
            }

            Console.WriteLine();

            Console.WriteLine("The server started successfully, press key 'q' to stop it!");

            while (Console.ReadKey().KeyChar != 'q')
            {
                Console.WriteLine();
                continue;
            }

            autoServer.StopServer();
            //Stop the appServer
            //websocketserver.Stop();

            Console.WriteLine("The server was stopped!");
            Console.ReadKey();
        }
コード例 #2
0
 protected override void OnStop()
 {
     m_AutoServer.StopServer();
 }