From 2db19b7d657c236e6f5e085cea5269983b99f909 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 22 Nov 2007 23:56:44 +0000 Subject: * Added more comments * Tweaked the esoteric throttler parameters again. --- OpenSim/Region/ClientStack/ClientView.PacketQueue.cs | 14 +++++++------- OpenSim/Region/ClientStack/ClientView.cs | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/ClientStack/ClientView.PacketQueue.cs b/OpenSim/Region/ClientStack/ClientView.PacketQueue.cs index bd22970..1904bfa 100644 --- a/OpenSim/Region/ClientStack/ClientView.PacketQueue.cs +++ b/OpenSim/Region/ClientStack/ClientView.PacketQueue.cs @@ -231,7 +231,7 @@ namespace OpenSim.Region.ClientStack switch (throttlePacketType) { case ThrottleOutPacketType.Resend: - if (ResendthrottleSentPeriod <= ResendthrottleOutbound && ResendOutgoingPacketQueue.Count == 0) + if (ResendthrottleSentPeriod <= ((int)(ResendthrottleOutbound / throttleTimeDivisor)) && ResendOutgoingPacketQueue.Count == 0) { throttleSentPeriod += item.Packet.ToBytes().Length; ResendthrottleSentPeriod += item.Packet.ToBytes().Length; @@ -243,7 +243,7 @@ namespace OpenSim.Region.ClientStack } break; case ThrottleOutPacketType.Texture: - if (TexturethrottleSentPeriod <= TexturethrottleOutbound && TextureOutgoingPacketQueue.Count == 0) + if (TexturethrottleSentPeriod <= ((int)(TexturethrottleOutbound / throttleTimeDivisor)) && TextureOutgoingPacketQueue.Count == 0) { throttleSentPeriod += item.Packet.ToBytes().Length; TexturethrottleSentPeriod += item.Packet.ToBytes().Length; @@ -255,7 +255,7 @@ namespace OpenSim.Region.ClientStack } break; case ThrottleOutPacketType.Task: - if (TaskthrottleSentPeriod <= TaskthrottleOutbound && TaskOutgoingPacketQueue.Count == 0) + if (TaskthrottleSentPeriod <= ((int)(TexturethrottleOutbound / throttleTimeDivisor)) && TaskOutgoingPacketQueue.Count == 0) { throttleSentPeriod += item.Packet.ToBytes().Length; TaskthrottleSentPeriod += item.Packet.ToBytes().Length; @@ -267,7 +267,7 @@ namespace OpenSim.Region.ClientStack } break; case ThrottleOutPacketType.Land: - if (LandthrottleSentPeriod <= LandthrottleOutbound && LandOutgoingPacketQueue.Count == 0) + if (LandthrottleSentPeriod <= ((int)(LandthrottleOutbound / throttleTimeDivisor)) && LandOutgoingPacketQueue.Count == 0) { throttleSentPeriod += item.Packet.ToBytes().Length; LandthrottleSentPeriod += item.Packet.ToBytes().Length; @@ -279,7 +279,7 @@ namespace OpenSim.Region.ClientStack } break; case ThrottleOutPacketType.Asset: - if (AssetthrottleSentPeriod <= AssetthrottleOutbound && AssetOutgoingPacketQueue.Count == 0) + if (AssetthrottleSentPeriod <= ((int)(AssetthrottleOutbound / throttleTimeDivisor)) && AssetOutgoingPacketQueue.Count == 0) { throttleSentPeriod += item.Packet.ToBytes().Length; AssetthrottleSentPeriod += item.Packet.ToBytes().Length; @@ -291,7 +291,7 @@ namespace OpenSim.Region.ClientStack } break; case ThrottleOutPacketType.Cloud: - if (CloudthrottleSentPeriod <= CloudthrottleOutbound && CloudOutgoingPacketQueue.Count == 0) + if (CloudthrottleSentPeriod <= ((int)(CloudthrottleOutbound / throttleTimeDivisor)) && CloudOutgoingPacketQueue.Count == 0) { throttleSentPeriod += item.Packet.ToBytes().Length; CloudthrottleSentPeriod += item.Packet.ToBytes().Length; @@ -303,7 +303,7 @@ namespace OpenSim.Region.ClientStack } break; case ThrottleOutPacketType.Wind: - if (WindthrottleSentPeriod <= WindthrottleOutbound && WindOutgoingPacketQueue.Count == 0) + if (WindthrottleSentPeriod <= ((int)(WindthrottleOutbound / throttleTimeDivisor)) && WindOutgoingPacketQueue.Count == 0) { throttleSentPeriod += item.Packet.ToBytes().Length; WindthrottleSentPeriod += item.Packet.ToBytes().Length; diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index b4441ec..e6712fe 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -96,6 +96,9 @@ namespace OpenSim.Region.ClientStack // TODO: Make this variable. Lower throttle on un-ack. Raise over time // All throttle times and number of bytes are calculated by dividing by this value + // This value also determines how many times per throttletimems the timer will run + // If throttleimems is 1000 ms, then the timer will fire every 1000/7 milliseconds + private int throttleTimeDivisor = 7; private int throttletimems = 1000; -- cgit v1.1