示例#1
0
        public void OnApplicationIdle(object sender, EventArgs e)
        {
            while (AppStillIdle)
            {
                // Quando estiver inicializando.
                if (Server.Initialized)
                {
                    // Processa
                    if (Server.ServerRunning)
                    {
                        Server.ServerLoop();

                        if (Configuration.Sleep > 0)
                        {
                            Thread.Sleep(Configuration.Sleep);
                        }
                    }
                    else
                    {
                        Server.StopServer();
                        Application.Exit();
                    }
                }
            }
        }