From 2b737c9cc2e4a4ef3520d80225381a010bd1dc80 Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Wed, 20 Apr 2011 16:23:33 -0700
Subject: Adds the first pass at an adaptive throttle to slow start new
clients. If the sent packets are ack'ed successfully the throttle will open
quickly up to the maximum specified by the client and/or the sims client
throttle.
This still needs a lot of adjustment to get the rates correct.
---
OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index 7be8a0a..20bfec8 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -135,7 +135,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private int m_nextOnQueueEmpty = 1;
/// Throttle bucket for this agent's connection
- private readonly TokenBucket m_throttleClient;
+ private readonly AdaptiveTokenBucket m_throttleClient;
+ public AdaptiveTokenBucket FlowThrottle
+ {
+ get { return m_throttleClient; }
+ }
+
/// Throttle bucket for this agent's connection
private readonly TokenBucket m_throttleCategory;
/// Throttle buckets for each packet category
@@ -176,7 +181,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_maxRTO = maxRTO;
// Create a token bucket throttle for this client that has the scene token bucket as a parent
- m_throttleClient = new TokenBucket(parentThrottle, rates.TotalLimit);
+ m_throttleClient = new AdaptiveTokenBucket(parentThrottle, rates.TotalLimit);
// Create a token bucket throttle for the total categary with the client bucket as a throttle
m_throttleCategory = new TokenBucket(m_throttleClient, rates.TotalLimit);
// Create an array of token buckets for this clients different throttle categories
--
cgit v1.1