aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs27
1 files changed, 22 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index a9bc7d2..84a4959 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -304,8 +304,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
304 304
305 int total = resend + land + wind + cloud + task + texture + asset + state; 305 int total = resend + land + wind + cloud + task + texture + asset + state;
306 306
307 m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, State={8}, Total={9}", 307 //m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, State={8}, Total={9}",
308 AgentID, resend, land, wind, cloud, task, texture, asset, state, total); 308 // AgentID, resend, land, wind, cloud, task, texture, asset, state, total);
309 309
310 // Update the token buckets with new throttle values 310 // Update the token buckets with new throttle values
311 TokenBucket bucket; 311 TokenBucket bucket;
@@ -372,7 +372,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
372 OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; 372 OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category];
373 TokenBucket bucket = m_throttleCategories[category]; 373 TokenBucket bucket = m_throttleCategories[category];
374 374
375 if (m_throttleCategories[category].RemoveTokens(packet.Buffer.DataLength)) 375 if (bucket.RemoveTokens(packet.Buffer.DataLength))
376 { 376 {
377 // Enough tokens were removed from the bucket, the packet will not be queued 377 // Enough tokens were removed from the bucket, the packet will not be queued
378 return false; 378 return false;
@@ -497,16 +497,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP
497 SRTT = (1.0f - ALPHA) * SRTT + ALPHA * r; 497 SRTT = (1.0f - ALPHA) * SRTT + ALPHA * r;
498 } 498 }
499 499
500 RTO = (int)(SRTT + Math.Max(m_udpServer.TickCountResolution, K * RTTVAR)); 500 int rto = (int)(SRTT + Math.Max(m_udpServer.TickCountResolution, K * RTTVAR));
501 501
502 // Clamp the retransmission timeout to manageable values 502 // Clamp the retransmission timeout to manageable values
503 RTO = Utils.Clamp(RTO, 3000, 10000); 503 rto = Utils.Clamp(RTO, 3000, 60000);
504
505 RTO = rto;
504 506
505 //m_log.Debug("[LLUDPCLIENT]: Setting agent " + this.Agent.FullName + "'s RTO to " + RTO + "ms with an RTTVAR of " + 507 //m_log.Debug("[LLUDPCLIENT]: Setting agent " + this.Agent.FullName + "'s RTO to " + RTO + "ms with an RTTVAR of " +
506 // RTTVAR + " based on new RTT of " + r + "ms"); 508 // RTTVAR + " based on new RTT of " + r + "ms");
507 } 509 }
508 510
509 /// <summary> 511 /// <summary>
512 /// Exponential backoff of the retransmission timeout, per section 5.5
513 /// of RFC 2988
514 /// </summary>
515 public void BackoffRTO()
516 {
517 // Reset SRTT and RTTVAR, we assume they are bogus since things
518 // didn't work out and we're backing off the timeout
519 SRTT = 0.0f;
520 RTTVAR = 0.0f;
521
522 // Double the retransmission timeout
523 RTO = Math.Min(RTO * 2, 60000);
524 }
525
526 /// <summary>
510 /// Does an early check to see if this queue empty callback is already 527 /// Does an early check to see if this queue empty callback is already
511 /// running, then asynchronously firing the event 528 /// running, then asynchronously firing the event
512 /// </summary> 529 /// </summary>