예제 #1
0
        protected override void OnStart(string[] args)
        {
            _serviceManager = ServerManager.Servers();

            Task.Run(() =>
            {
                _serviceManager.StartAll();
                _serviceManager.WaitForConnections();
            });
        }
예제 #2
0
        private static void Main(string[] args)
        {
            _serviceManager = ServerManager.Servers();

            Task.Run(() =>
            {
                _serviceManager.StartAll();

                foreach (var s in _serviceManager.AllServers)
                {
                    System.Console.WriteLine("Listening on {0}", s.Port);
                }

                _serviceManager.WaitForConnections();
            });

            System.Console.ReadLine();
        }