Example #1
0
        /*-----------------------------------------------------------------------------*/

        /// <summary>
        /// Exits the program.
        /// </summary>
        public static void quit()
        {
            Console.WriteLine("Exiting program... ");

            Program.setExitStatus(true);

            //Stops the 2 udp threads.
            NetworkConfig.stopUDPServer();

            Environment.Exit(0);
        }
Example #2
0
        /*--------------------------------------------------------------------------------------*/
        #endregion

        /// <summary>
        /// Core of the program, automatically executed
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            NetworkConfig.startUDPServer();

            Thread thread = new Thread(Server.startTCPlisteners);

            thread.Start();

            StatusText.showWelcomeMessage();

            while (EXIT_STATUS == false)
            {
                parseCommand(typeInRequest());

                //Erases the IP list in order to avoid disconnected guests.
                NetworkConfig.refreshIPList();

                //Pause in order for all other hosts to have time to send their IP again.
                Thread.Sleep(50);

                Client.executeRequest();
            }
        }