aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/ClientView.cs
diff options
context:
space:
mode:
authorSean Dague2007-11-27 20:37:17 +0000
committerSean Dague2007-11-27 20:37:17 +0000
commitcebdd069f49a5ba6e5bc84eb5e96a63320795226 (patch)
tree1f4cd4022c9cf94ed87081fdabcd62021ccb248d /OpenSim/Region/ClientStack/ClientView.cs
parentFixed bug, where the clients in a region weren't told to kill a user's avatar... (diff)
downloadopensim-SC-cebdd069f49a5ba6e5bc84eb5e96a63320795226.zip
opensim-SC-cebdd069f49a5ba6e5bc84eb5e96a63320795226.tar.gz
opensim-SC-cebdd069f49a5ba6e5bc84eb5e96a63320795226.tar.bz2
opensim-SC-cebdd069f49a5ba6e5bc84eb5e96a63320795226.tar.xz
some variable renames to help me read the throttle code
Diffstat (limited to 'OpenSim/Region/ClientStack/ClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs80
1 files changed, 40 insertions, 40 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index fbe66db..28692bb 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -90,7 +90,7 @@ namespace OpenSim.Region.ClientStack
90 // 1536000 90 // 1536000
91 private int throttleOutboundMax = 1536000; // Number of bytes allowed to go out per second. (256kbps per client) 91 private int throttleOutboundMax = 1536000; // Number of bytes allowed to go out per second. (256kbps per client)
92 // TODO: Make this variable. Lower throttle on un-ack. Raise over time? 92 // TODO: Make this variable. Lower throttle on un-ack. Raise over time?
93 private int throttleSentPeriod = 0; // Number of bytes sent this period 93 private int bytesSent = 0; // Number of bytes sent this period
94 94
95 private int throttleOutbound = 162144; // Number of bytes allowed to go out per second. (256kbps per client) 95 private int throttleOutbound = 162144; // Number of bytes allowed to go out per second. (256kbps per client)
96 // TODO: Make this variable. Lower throttle on un-ack. Raise over time 96 // TODO: Make this variable. Lower throttle on un-ack. Raise over time
@@ -123,19 +123,19 @@ namespace OpenSim.Region.ClientStack
123 123
124 // Sim default per-client settings. 124 // Sim default per-client settings.
125 private int ResendthrottleOutbound = 50000; 125 private int ResendthrottleOutbound = 50000;
126 private int ResendthrottleSentPeriod = 0; 126 private int ResendBytesSent = 0;
127 private int LandthrottleOutbound = 100000; 127 private int LandthrottleOutbound = 100000;
128 private int LandthrottleSentPeriod = 0; 128 private int LandBytesSent = 0;
129 private int WindthrottleOutbound = 10000; 129 private int WindthrottleOutbound = 10000;
130 private int WindthrottleSentPeriod = 0; 130 private int WindBytesSent = 0;
131 private int CloudthrottleOutbound = 5000; 131 private int CloudthrottleOutbound = 5000;
132 private int CloudthrottleSentPeriod = 0; 132 private int CloudBytesSent = 0;
133 private int TaskthrottleOutbound = 100000; 133 private int TaskthrottleOutbound = 100000;
134 private int TaskthrottleSentPeriod = 0; 134 private int TaskBytesSent = 0;
135 private int AssetthrottleOutbound = 80000; 135 private int AssetthrottleOutbound = 80000;
136 private int AssetthrottleSentPeriod = 0; 136 private int AssetBytesSent = 0;
137 private int TexturethrottleOutbound = 100000; 137 private int TexturethrottleOutbound = 100000;
138 private int TexturethrottleSentPeriod = 0; 138 private int TextureBytesSent = 0;
139 139
140 private Timer throttleTimer; 140 private Timer throttleTimer;
141 141
@@ -196,14 +196,14 @@ namespace OpenSim.Region.ClientStack
196 196
197 void throttleTimer_Elapsed(object sender, ElapsedEventArgs e) 197 void throttleTimer_Elapsed(object sender, ElapsedEventArgs e)
198 { 198 {
199 throttleSentPeriod = 0; 199 bytesSent = 0;
200 ResendthrottleSentPeriod = 0; 200 ResendBytesSent = 0;
201 LandthrottleSentPeriod = 0; 201 LandBytesSent = 0;
202 WindthrottleSentPeriod = 0; 202 WindBytesSent = 0;
203 CloudthrottleSentPeriod = 0; 203 CloudBytesSent = 0;
204 TaskthrottleSentPeriod = 0; 204 TaskBytesSent = 0;
205 AssetthrottleSentPeriod = 0; 205 AssetBytesSent = 0;
206 TexturethrottleSentPeriod = 0; 206 TextureBytesSent = 0;
207 207
208 // I was considering this.. Will an event fire if the thread it's on is blocked? 208 // I was considering this.. Will an event fire if the thread it's on is blocked?
209 209
@@ -216,7 +216,7 @@ namespace OpenSim.Region.ClientStack
216 216
217 // We're going to dequeue all of the saved up packets until 217 // We're going to dequeue all of the saved up packets until
218 // we've hit the throttle limit or there's no more packets to send 218 // we've hit the throttle limit or there's no more packets to send
219 while ((throttleSentPeriod <= ((int)(throttleOutbound/throttleTimeDivisor)) && 219 while ((bytesSent <= ((int)(throttleOutbound/throttleTimeDivisor)) &&
220 (ResendOutgoingPacketQueue.Count > 0 || 220 (ResendOutgoingPacketQueue.Count > 0 ||
221 LandOutgoingPacketQueue.Count > 0 || 221 LandOutgoingPacketQueue.Count > 0 ||
222 WindOutgoingPacketQueue.Count > 0 || 222 WindOutgoingPacketQueue.Count > 0 ||
@@ -227,61 +227,61 @@ namespace OpenSim.Region.ClientStack
227 { 227 {
228 throttleLoops++; 228 throttleLoops++;
229 //Now comes the fun part.. we dump all our elements into PacketQueue that we've saved up. 229 //Now comes the fun part.. we dump all our elements into PacketQueue that we've saved up.
230 if (ResendthrottleSentPeriod <= ((int)(ResendthrottleOutbound/throttleTimeDivisor)) && ResendOutgoingPacketQueue.Count > 0) 230 if (ResendBytesSent <= ((int)(ResendthrottleOutbound/throttleTimeDivisor)) && ResendOutgoingPacketQueue.Count > 0)
231 { 231 {
232 QueItem qpack = ResendOutgoingPacketQueue.Dequeue(); 232 QueItem qpack = ResendOutgoingPacketQueue.Dequeue();
233 233
234 PacketQueue.Enqueue(qpack); 234 PacketQueue.Enqueue(qpack);
235 throttleSentPeriod += qpack.Packet.ToBytes().Length; 235 bytesSent += qpack.Packet.ToBytes().Length;
236 ResendthrottleSentPeriod += qpack.Packet.ToBytes().Length; 236 ResendBytesSent += qpack.Packet.ToBytes().Length;
237 } 237 }
238 if (LandthrottleSentPeriod <= ((int)(LandthrottleOutbound/throttleTimeDivisor)) && LandOutgoingPacketQueue.Count > 0) 238 if (LandBytesSent <= ((int)(LandthrottleOutbound/throttleTimeDivisor)) && LandOutgoingPacketQueue.Count > 0)
239 { 239 {
240 QueItem qpack = LandOutgoingPacketQueue.Dequeue(); 240 QueItem qpack = LandOutgoingPacketQueue.Dequeue();
241 241
242 PacketQueue.Enqueue(qpack); 242 PacketQueue.Enqueue(qpack);
243 throttleSentPeriod += qpack.Packet.ToBytes().Length; 243 bytesSent += qpack.Packet.ToBytes().Length;
244 LandthrottleSentPeriod += qpack.Packet.ToBytes().Length; 244 LandBytesSent += qpack.Packet.ToBytes().Length;
245 } 245 }
246 if (WindthrottleSentPeriod <= ((int)(WindthrottleOutbound/throttleTimeDivisor)) && WindOutgoingPacketQueue.Count > 0) 246 if (WindBytesSent <= ((int)(WindthrottleOutbound/throttleTimeDivisor)) && WindOutgoingPacketQueue.Count > 0)
247 { 247 {
248 QueItem qpack = WindOutgoingPacketQueue.Dequeue(); 248 QueItem qpack = WindOutgoingPacketQueue.Dequeue();
249 249
250 PacketQueue.Enqueue(qpack); 250 PacketQueue.Enqueue(qpack);
251 throttleSentPeriod += qpack.Packet.ToBytes().Length; 251 bytesSent += qpack.Packet.ToBytes().Length;
252 WindthrottleSentPeriod += qpack.Packet.ToBytes().Length; 252 WindBytesSent += qpack.Packet.ToBytes().Length;
253 } 253 }
254 if (CloudthrottleSentPeriod <= ((int)(CloudthrottleOutbound/throttleTimeDivisor)) && CloudOutgoingPacketQueue.Count > 0) 254 if (CloudBytesSent <= ((int)(CloudthrottleOutbound/throttleTimeDivisor)) && CloudOutgoingPacketQueue.Count > 0)
255 { 255 {
256 QueItem qpack = CloudOutgoingPacketQueue.Dequeue(); 256 QueItem qpack = CloudOutgoingPacketQueue.Dequeue();
257 257
258 PacketQueue.Enqueue(qpack); 258 PacketQueue.Enqueue(qpack);
259 throttleSentPeriod += qpack.Packet.ToBytes().Length; 259 bytesSent += qpack.Packet.ToBytes().Length;
260 CloudthrottleSentPeriod += qpack.Packet.ToBytes().Length; 260 CloudBytesSent += qpack.Packet.ToBytes().Length;
261 } 261 }
262 if (TaskthrottleSentPeriod <= ((int)(TaskthrottleOutbound/throttleTimeDivisor)) && TaskOutgoingPacketQueue.Count > 0) 262 if (TaskBytesSent <= ((int)(TaskthrottleOutbound/throttleTimeDivisor)) && TaskOutgoingPacketQueue.Count > 0)
263 { 263 {
264 QueItem qpack = TaskOutgoingPacketQueue.Dequeue(); 264 QueItem qpack = TaskOutgoingPacketQueue.Dequeue();
265 265
266 PacketQueue.Enqueue(qpack); 266 PacketQueue.Enqueue(qpack);
267 throttleSentPeriod += qpack.Packet.ToBytes().Length; 267 bytesSent += qpack.Packet.ToBytes().Length;
268 TaskthrottleSentPeriod += qpack.Packet.ToBytes().Length; 268 TaskBytesSent += qpack.Packet.ToBytes().Length;
269 } 269 }
270 if (TexturethrottleSentPeriod <= ((int)(TexturethrottleOutbound/throttleTimeDivisor)) && TextureOutgoingPacketQueue.Count > 0) 270 if (TextureBytesSent <= ((int)(TexturethrottleOutbound/throttleTimeDivisor)) && TextureOutgoingPacketQueue.Count > 0)
271 { 271 {
272 QueItem qpack = TextureOutgoingPacketQueue.Dequeue(); 272 QueItem qpack = TextureOutgoingPacketQueue.Dequeue();
273 273
274 PacketQueue.Enqueue(qpack); 274 PacketQueue.Enqueue(qpack);
275 throttleSentPeriod += qpack.Packet.ToBytes().Length; 275 bytesSent += qpack.Packet.ToBytes().Length;
276 TexturethrottleSentPeriod += qpack.Packet.ToBytes().Length; 276 TextureBytesSent += qpack.Packet.ToBytes().Length;
277 } 277 }
278 if (AssetthrottleSentPeriod <= ((int)(AssetthrottleOutbound/throttleTimeDivisor)) && AssetOutgoingPacketQueue.Count > 0) 278 if (AssetBytesSent <= ((int)(AssetthrottleOutbound/throttleTimeDivisor)) && AssetOutgoingPacketQueue.Count > 0)
279 { 279 {
280 QueItem qpack = AssetOutgoingPacketQueue.Dequeue(); 280 QueItem qpack = AssetOutgoingPacketQueue.Dequeue();
281 281
282 PacketQueue.Enqueue(qpack); 282 PacketQueue.Enqueue(qpack);
283 throttleSentPeriod += qpack.Packet.ToBytes().Length; 283 bytesSent += qpack.Packet.ToBytes().Length;
284 AssetthrottleSentPeriod += qpack.Packet.ToBytes().Length; 284 AssetBytesSent += qpack.Packet.ToBytes().Length;
285 } 285 }
286 286
287 } 287 }
@@ -441,7 +441,7 @@ namespace OpenSim.Region.ClientStack
441 else 441 else
442 { 442 {
443 // Throw it back on the queue if it's going to cause us to flood the client 443 // Throw it back on the queue if it's going to cause us to flood the client
444 if (throttleSentPeriod > throttleOutboundMax) 444 if (bytesSent > throttleOutboundMax)
445 { 445 {
446 PacketQueue.Enqueue(nextPacket); 446 PacketQueue.Enqueue(nextPacket);
447 MainLog.Instance.Verbose("Client over throttle limit, requeuing packet"); 447 MainLog.Instance.Verbose("Client over throttle limit, requeuing packet");
@@ -462,7 +462,7 @@ namespace OpenSim.Region.ClientStack
462 462
463 //Don't throttle AvatarPickerReplies!, they return a null .ToBytes()! 463 //Don't throttle AvatarPickerReplies!, they return a null .ToBytes()!
464 if (nextPacket.Packet.Type != PacketType.AvatarPickerReply) 464 if (nextPacket.Packet.Type != PacketType.AvatarPickerReply)
465 throttleSentPeriod += nextPacket.Packet.ToBytes().Length; 465 bytesSent += nextPacket.Packet.ToBytes().Length;
466 466
467 467
468 //is a out going packet 468 //is a out going packet