コード例 #1
0
ファイル: Program.cs プロジェクト: zanecodes/Mobile
        /// <summary>
        /// Main entry for the application
        /// </summary>
        public static void Main()
        {
            // Initialize the connection string
            InitConnection();

            try {
                // Get the server version from the external text file
                UpdateServerVersion();
            } catch {
                // If could not get the version, default it to 0.0
                Console.WriteLine("Could not get version.");
                return;
            }

            var TM = new ThreadManager();

            // Start the monitors for the Directions Handler
            DirectionsFinder.EnqueueMonitors(TM);

            // Start the expiration checker for admin logins
            TM.Enqueue(AdminHandler.DeleteExpiredLogins(TM), ThreadPriority.Low);

            // Start the listener for console commands
            TM.Enqueue(HandleConsoleRequests(TM), ThreadPriority.Low);

            // Start the listener for HTTP requests
            TM.Enqueue(WebController.HandleClients(TM));

            // Start the ThreadManager
            TM.Start(1);
        }