Exemple #1
0
        private static void ServerLoop()
        {
            int num = 0;

            Netplay.StartBroadCasting();
            while (!Netplay.Disconnect)
            {
                Netplay.StartListeningIfNeeded();
                Netplay.UpdateConnectedClients();
                num = (num + 1) % 10;
                Thread.Sleep(num == 0 ? 1 : 0);
            }
            Netplay.StopBroadCasting();
            Netplay.CleanupServer();
        }