From 7861390f72bfccb2231e126636afc2565d7f8d02 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 9 Nov 2007 02:26:26 +0000 Subject: * Tweaked how the throttle works. --- OpenSim/Region/ClientStack/ClientView.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 2cd7711..75c69c2 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -246,6 +246,8 @@ namespace OpenSim.Region.ClientStack protected virtual void ClientLoop() { + QueItem lastPacket = null; + MainLog.Instance.Verbose("CLIENT", "Entered loop"); while (true) { @@ -266,7 +268,13 @@ namespace OpenSim.Region.ClientStack if (throttleSentPeriod > throttleOutbound) { PacketQueue.Enqueue(nextPacket); - Thread.Sleep(100); // Wait a little while, should prevent a CPU spike during high transmission periods + + if (lastPacket == nextPacket) + { + Thread.Sleep(100); // Wait a little while if this was the last packet we saw + } + + lastPacket = nextPacket; } else { -- cgit v1.1