示例#1
0
        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);
                }
            }
        }
示例#2
0
        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);
            }
        }