Beispiel #1
0
        public void TimeoutIsResetWhenUnpaused()
        {
            server.Start(Port);
            ConnectClientBlocking();

            // pause for Timeout + 1 seconds
            client.Pause();
            server.Pause();
            Thread.Sleep(KcpConnection.TIMEOUT + 1);

            // unpause
            client.Unpause();
            server.Unpause();

            // update both. neither should time out if Unpause has reset the
            // timeout.
            UpdateSeveralTimes();
            Assert.That(client.connected, Is.True);
            Assert.That(server.connections.Count, Is.EqualTo(1));
        }