aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs74
1 files changed, 8 insertions, 66 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
index 9293882..86a7188 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
@@ -96,9 +96,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
96 set 96 set
97 { 97 {
98 m_throttleDebugLevel = value; 98 m_throttleDebugLevel = value;
99/*
99 m_throttleClient.DebugLevel = m_throttleDebugLevel; 100 m_throttleClient.DebugLevel = m_throttleDebugLevel;
100 foreach (TokenBucket tb in m_throttleCategories) 101 foreach (TokenBucket tb in m_throttleCategories)
101 tb.DebugLevel = m_throttleDebugLevel; 102 tb.DebugLevel = m_throttleDebugLevel;
103 */
102 } 104 }
103 } 105 }
104 private int m_throttleDebugLevel; 106 private int m_throttleDebugLevel;
@@ -250,22 +252,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
250 if (maxRTO != 0) 252 if (maxRTO != 0)
251 m_maxRTO = maxRTO; 253 m_maxRTO = maxRTO;
252 254
253<<<<<<< HEAD
254 ProcessUnackedSends = true;
255
256 // Create a token bucket throttle for this client that has the scene token bucket as a parent
257 m_throttleClient
258 = new AdaptiveTokenBucket(
259 string.Format("adaptive throttle for {0} in {1}", AgentID, server.Scene.Name),
260 parentThrottle, 0, rates.Total, rates.MinimumAdaptiveThrottleRate, rates.AdaptiveThrottlesEnabled);
261
262=======
263 m_burstTime = rates.BrustTime; 255 m_burstTime = rates.BrustTime;
264 float m_burst = rates.ClientMaxRate * m_burstTime; 256 float m_burst = rates.ClientMaxRate * m_burstTime;
265 257
266 // Create a token bucket throttle for this client that has the scene token bucket as a parent 258 // Create a token bucket throttle for this client that has the scene token bucket as a parent
267 m_throttleClient = new AdaptiveTokenBucket(parentThrottle, rates.ClientMaxRate, m_burst, rates.AdaptiveThrottlesEnabled); 259 m_throttleClient = new AdaptiveTokenBucket(parentThrottle, rates.ClientMaxRate, m_burst, rates.AdaptiveThrottlesEnabled);
268>>>>>>> avn/ubitvar 260
269 // Create an array of token buckets for this clients different throttle categories 261 // Create an array of token buckets for this clients different throttle categories
270 m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT]; 262 m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT];
271 263
@@ -278,19 +270,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
278 ThrottleOutPacketType type = (ThrottleOutPacketType)i; 270 ThrottleOutPacketType type = (ThrottleOutPacketType)i;
279 271
280 // Initialize the packet outboxes, where packets sit while they are waiting for tokens 272 // Initialize the packet outboxes, where packets sit while they are waiting for tokens
281<<<<<<< HEAD
282 m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue<OutgoingPacket>();
283
284 // Initialize the token buckets that control the throttling for each category
285 m_throttleCategories[i]
286 = new TokenBucket(
287 string.Format("{0} throttle for {1} in {2}", type, AgentID, server.Scene.Name),
288 m_throttleClient, rates.GetRate(type), 0);
289=======
290 m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>(); 273 m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>();
291 // Initialize the token buckets that control the throttling for each category 274 // Initialize the token buckets that control the throttling for each category
292 m_throttleCategories[i] = new TokenBucket(m_throttleClient, rates.GetRate(type), m_burst); 275 m_throttleCategories[i] = new TokenBucket(m_throttleClient, rates.GetRate(type), m_burst);
293>>>>>>> avn/ubitvar
294 } 276 }
295 277
296 // Default the retransmission timeout to one second 278 // Default the retransmission timeout to one second
@@ -337,12 +319,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
337 m_info.assetThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Asset].DripRate; 319 m_info.assetThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Asset].DripRate;
338 m_info.textureThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Texture].DripRate; 320 m_info.textureThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Texture].DripRate;
339 m_info.totalThrottle = (int)m_throttleClient.DripRate; 321 m_info.totalThrottle = (int)m_throttleClient.DripRate;
340<<<<<<< HEAD
341 m_info.targetThrottle = (int)m_throttleClient.TargetDripRate;
342 m_info.maxThrottle = (int)m_throttleClient.MaxDripRate;
343=======
344>>>>>>> avn/ubitvar
345
346 return m_info; 322 return m_info;
347 } 323 }
348 324
@@ -460,13 +436,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
460 int texture = (int)(BitConverter.ToSingle(adjData, pos) * scale); pos += 4; 436 int texture = (int)(BitConverter.ToSingle(adjData, pos) * scale); pos += 4;
461 int asset = (int)(BitConverter.ToSingle(adjData, pos) * scale); 437 int asset = (int)(BitConverter.ToSingle(adjData, pos) * scale);
462 438
463 if (ThrottleDebugLevel > 0) 439
464 {
465 long total = resend + land + wind + cloud + task + texture + asset;
466 m_log.DebugFormat(
467 "[LLUDPCLIENT]: {0} is setting throttles in {1} to Resend={2}, Land={3}, Wind={4}, Cloud={5}, Task={6}, Texture={7}, Asset={8}, TOTAL = {9}",
468 AgentID, m_udpServer.Scene.Name, resend, land, wind, cloud, task, texture, asset, total);
469 }
470 440
471 // Make sure none of the throttles are set below our packet MTU, 441 // Make sure none of the throttles are set below our packet MTU,
472 // otherwise a throttle could become permanently clogged 442 // otherwise a throttle could become permanently clogged
@@ -486,32 +456,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
486 // the task queue (e.g. object updates) 456 // the task queue (e.g. object updates)
487 task = task + (int)(m_cannibalrate * texture); 457 task = task + (int)(m_cannibalrate * texture);
488 texture = (int)((1 - m_cannibalrate) * texture); 458 texture = (int)((1 - m_cannibalrate) * texture);
489<<<<<<< HEAD
490
491 //int total = resend + land + wind + cloud + task + texture + asset;
492
493 if (ThrottleDebugLevel > 0)
494 {
495 long total = resend + land + wind + cloud + task + texture + asset;
496 m_log.DebugFormat(
497 "[LLUDPCLIENT]: {0} is setting throttles in {1} to Resend={2}, Land={3}, Wind={4}, Cloud={5}, Task={6}, Texture={7}, Asset={8}, TOTAL = {9}",
498 AgentID, m_udpServer.Scene.Name, resend, land, wind, cloud, task, texture, asset, total);
499 }
500=======
501 459
502 int total = resend + land + wind + cloud + task + texture + asset; 460 int total = resend + land + wind + cloud + task + texture + asset;
503 461
504 float m_burst = total * m_burstTime; 462 float m_burst = total * m_burstTime;
505 463
506 //m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, Total={8}", 464 if (ThrottleDebugLevel > 0)
507 // AgentID, resend, land, wind, cloud, task, texture, asset, total);
508>>>>>>> avn/ubitvar
509
510 // Update the token buckets with new throttle values
511 if (m_throttleClient.AdaptiveEnabled)
512 { 465 {
513 long total = resend + land + wind + cloud + task + texture + asset; 466 m_log.DebugFormat(
514 m_throttleClient.TargetDripRate = total; 467 "[LLUDPCLIENT]: {0} is setting throttles in {1} to Resend={2}, Land={3}, Wind={4}, Cloud={5}, Task={6}, Texture={7}, Asset={8}, TOTAL = {9}",
468 AgentID, m_udpServer.Scene.Name, resend, land, wind, cloud, task, texture, asset, total);
515 } 469 }
516 470
517 TokenBucket bucket; 471 TokenBucket bucket;
@@ -887,20 +841,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
887 /// signature</param> 841 /// signature</param>
888 public void FireQueueEmpty(object o) 842 public void FireQueueEmpty(object o)
889 { 843 {
890<<<<<<< HEAD
891// m_log.DebugFormat("[LLUDPCLIENT]: FireQueueEmpty for {0} in {1}", AgentID, m_udpServer.Scene.Name);
892
893// int start = Environment.TickCount & Int32.MaxValue;
894// const int MIN_CALLBACK_MS = 30;
895
896// if (m_udpServer.IsRunningOutbound)
897// {
898 ThrottleOutPacketTypeFlags categories = (ThrottleOutPacketTypeFlags)o;
899 QueueEmpty callback = OnQueueEmpty;
900=======
901 ThrottleOutPacketTypeFlags categories = (ThrottleOutPacketTypeFlags)o; 844 ThrottleOutPacketTypeFlags categories = (ThrottleOutPacketTypeFlags)o;
902 QueueEmpty callback = OnQueueEmpty; 845 QueueEmpty callback = OnQueueEmpty;
903>>>>>>> avn/ubitvar
904 846
905 if (callback != null) 847 if (callback != null)
906 { 848 {