Exemple #1
0
        static void Main(string[] args)
        {
            var serverX = new ServerX();

            serverX.Init(null);
            Console.ReadKey();
        }
        private void StartServer()
        {
            if (ServerX.IsRunning)
            {
                ServerX.Stop();
            }

            ServerX.Start();
            Console.WriteLine("Socket server X has been started!");
        }
        public void StopServer()
        {
            if (ServerX.IsRunning)
            {
                ServerX.Stop();
                Console.WriteLine("Socket server X has been stopped!");
            }

            if (ServerY != null && ServerY.IsRunning)
            {
                ServerY.Stop();
                Console.WriteLine("Socket server Y has been stopped!");
            }
        }