protected override void OnStart(string[] args) { _serviceManager = ServerManager.Servers(); Task.Run(() => { _serviceManager.StartAll(); _serviceManager.WaitForConnections(); }); }
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(); }