* Tweaked how the throttle works.

afrisby
Adam Frisby 2007-11-09 02:26:26 +00:00
parent 1875317127
commit 7861390f72
1 changed files with 9 additions and 1 deletions

View File

@ -246,6 +246,8 @@ namespace OpenSim.Region.ClientStack
protected virtual void ClientLoop() protected virtual void ClientLoop()
{ {
QueItem lastPacket = null;
MainLog.Instance.Verbose("CLIENT", "Entered loop"); MainLog.Instance.Verbose("CLIENT", "Entered loop");
while (true) while (true)
{ {
@ -266,7 +268,13 @@ namespace OpenSim.Region.ClientStack
if (throttleSentPeriod > throttleOutbound) if (throttleSentPeriod > throttleOutbound)
{ {
PacketQueue.Enqueue(nextPacket); 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 else
{ {