global using System; global using System.Collections.Generic; global using System.Threading; global using System.Threading.Tasks; global using Meum.Core; using DTLib.Console; using DTLib.Demystifier; using DTLib.Filesystem; using DTLib.Logging; namespace Meum.Server; static class Program { static readonly IOPath config_path = "Meum.Server.config.json"; static async Task Main(string[] args) { try { var config = ServerConfig.LoadOrCreate(config_path); var logger = new ConsoleLogger(); Functions.InitMsQuic(logger); var server = new Server(config, logger); await server.ListenAsync(); while (true) { try { var conn = await server.AcceptConnectionAsync(); } catch (Exception ex) { logger.LogError("Main", ex.ToStringDemystified()); } } } catch (Exception ex) { ColoredConsole.WriteLine(ex.ToStringDemystified(), ConsoleColor.Red); } finally { Console.ResetColor(); } } }