aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs19
1 files changed, 14 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
index e4e5e9a..1e03c88 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
@@ -34,6 +34,7 @@ using OpenMetaverse.Packets;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Statistics; 35using OpenSim.Framework.Statistics;
36using OpenSim.Framework.Statistics.Interfaces; 36using OpenSim.Framework.Statistics.Interfaces;
37using OpenSim.Region.ClientStack;
37using Timer=System.Timers.Timer; 38using Timer=System.Timers.Timer;
38 39
39 40
@@ -45,7 +46,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
45 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 46 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
46 47
47 /// <summary> 48 /// <summary>
48 /// Is throttling enabled at all? 49 /// Is queueing enabled at all?
49 /// </summary> 50 /// </summary>
50 private bool m_enabled = true; 51 private bool m_enabled = true;
51 52
@@ -88,7 +89,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
88 89
89 private UUID m_agentId; 90 private UUID m_agentId;
90 91
91 public LLPacketQueue(UUID agentId) 92 public LLPacketQueue(UUID agentId, ClientStackUserSettings userSettings)
92 { 93 {
93 // While working on this, the BlockingQueue had me fooled for a bit. 94 // While working on this, the BlockingQueue had me fooled for a bit.
94 // The Blocking queue causes the thread to stop until there's something 95 // The Blocking queue causes the thread to stop until there's something
@@ -108,7 +109,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
108 TextureOutgoingPacketQueue = new Queue<LLQueItem>(); 109 TextureOutgoingPacketQueue = new Queue<LLQueItem>();
109 AssetOutgoingPacketQueue = new Queue<LLQueItem>(); 110 AssetOutgoingPacketQueue = new Queue<LLQueItem>();
110 111
111
112 // Set up the throttle classes (min, max, current) in bytes 112 // Set up the throttle classes (min, max, current) in bytes
113 ResendThrottle = new LLPacketThrottle(5000, 100000, 16000); 113 ResendThrottle = new LLPacketThrottle(5000, 100000, 16000);
114 LandThrottle = new LLPacketThrottle(1000, 100000, 2000); 114 LandThrottle = new LLPacketThrottle(1000, 100000, 2000);
@@ -117,9 +117,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
117 TaskThrottle = new LLPacketThrottle(1000, 800000, 3000); 117 TaskThrottle = new LLPacketThrottle(1000, 800000, 3000);
118 AssetThrottle = new LLPacketThrottle(1000, 800000, 1000); 118 AssetThrottle = new LLPacketThrottle(1000, 800000, 1000);
119 TextureThrottle = new LLPacketThrottle(1000, 800000, 4000); 119 TextureThrottle = new LLPacketThrottle(1000, 800000, 4000);
120
120 // Total Throttle trumps all 121 // Total Throttle trumps all
121 // Number of bytes allowed to go out per second. (256kbps per client) 122 // Number of bytes allowed to go out per second.
122 TotalThrottle = new LLPacketThrottle(0, 1500000, 28000); 123 ThrottleSettings totalThrottleSettings = userSettings.TotalThrottleSettings;
124 if (null == totalThrottleSettings)
125 {
126 totalThrottleSettings = new ThrottleSettings(0, 1500000, 28000);
127 }
128
129 TotalThrottle
130 = new LLPacketThrottle(
131 totalThrottleSettings.Min, totalThrottleSettings.Max, totalThrottleSettings.Current);
123 132
124 throttleTimer = new Timer((int) (throttletimems/throttleTimeDivisor)); 133 throttleTimer = new Timer((int) (throttletimems/throttleTimeDivisor));
125 throttleTimer.Elapsed += new ElapsedEventHandler(ThrottleTimerElapsed); 134 throttleTimer.Elapsed += new ElapsedEventHandler(ThrottleTimerElapsed);