static void Main(string[] args) { var server = new AuthServer(); if (!Debugger.IsAttached) { try { server.Initialize(); server.Start(); GC.Collect(); while (true) { Thread.Sleep(5000); } } catch (Exception e) { server.HandleCrashException(e); } finally { server.Shutdown(); } } else { server.Initialize(); server.Start(); GC.Collect(); while (true) { Thread.Sleep(5000); } } }
private static void Main(string[] args) { AuthServer server = new AuthServer(); if (!Debugger.IsAttached) { try { Program.StartServer(ref server); } catch (Exception e) { server.HandleCrashException(e); } finally { server.Shutdown(); } } else { Program.StartServer(ref server); } }