static void Main(string[] args) { Console.Title = "IRC# Server"; Server = new IrcServer(); Config = new ServerConfig(); Config.Load(); Server.Hostname = Config.Host; for (int i = 0; i < Config.Ports.Length; i++) { int index = i; Thread thread = new Thread(() => Listen(index)) { IsBackground = true }; thread.Start(); } IrcServer.Logger.Log(LogLevel.Info, "Press ESC to exit."); while (Console.ReadKey().Key != ConsoleKey.Escape) { ; } }
static void Main(string[] args) { Console.Title = "IRC# Server"; Server = new IrcServer(); Config = new ServerConfig(); Config.Load(); Server.Hostname = Config.Host; for (int i = 0; i < Config.Ports.Length; i++) { int index = i; Thread thread = new Thread(() => Listen(index)) { IsBackground = true }; thread.Start(); } IrcServer.Logger.Log(LogLevel.Info, "Press ESC to exit."); while (Console.ReadKey().Key != ConsoleKey.Escape) ; }
static void Main(string[] args) { Console.Title = "IRC# Server"; Server = new IrcServer(); Config = new ServerConfig(); string TLS_string = "--tls"; foreach (string argument in args) { if (argument == TLS_string) { IrcServer.Logger.Log(LogLevel.Info, $"--tls detected"); Config.TLS = true; break; } else { IrcServer.Logger.Log(LogLevel.Info, $"No TLS"); Config.TLS = false; } } Config.Load(); Server.Hostname = Config.Host; for (int i = 0; i < Config.Ports.Length; i++) { int index = i; Thread thread = new Thread(() => Listen(index)) { IsBackground = true }; thread.Start(); } IrcServer.Logger.Log(LogLevel.Info, "Press ESC to exit."); while (Console.ReadKey().Key != ConsoleKey.Escape) { ; } }