Example #1
0
        /// <summary>
        /// Runs the exit logic
        /// </summary>
        private static void Exit()
        {
            LunaLog.Normal("Exiting... Please wait until all threads are finished");
            ExitEvent.Exit();

            CancellationTokenSrc.Cancel();
            Task.WaitAll(TaskContainer.ToArray());

            ServerContext.Shutdown("Server is shutting down");

            QuitEvent.Set();
        }