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.cs16
1 files changed, 12 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index 6619dcb..9856a1c 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -143,6 +143,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
143 /// <summary>A reference to the LLUDPServer that is managing this client</summary> 143 /// <summary>A reference to the LLUDPServer that is managing this client</summary>
144 private readonly LLUDPServer m_udpServer; 144 private readonly LLUDPServer m_udpServer;
145 145
146 private int m_defaultRTO = 3000;
147 private int m_maxRTO = 60000;
148
146 /// <summary> 149 /// <summary>
147 /// Default constructor 150 /// Default constructor
148 /// </summary> 151 /// </summary>
@@ -153,12 +156,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
153 /// <param name="circuitCode">Circuit code for this connection</param> 156 /// <param name="circuitCode">Circuit code for this connection</param>
154 /// <param name="agentID">AgentID for the connected agent</param> 157 /// <param name="agentID">AgentID for the connected agent</param>
155 /// <param name="remoteEndPoint">Remote endpoint for this connection</param> 158 /// <param name="remoteEndPoint">Remote endpoint for this connection</param>
156 public LLUDPClient(LLUDPServer server, ThrottleRates rates, TokenBucket parentThrottle, uint circuitCode, UUID agentID, IPEndPoint remoteEndPoint) 159 public LLUDPClient(LLUDPServer server, ThrottleRates rates, TokenBucket parentThrottle, uint circuitCode, UUID agentID, IPEndPoint remoteEndPoint, int defaultRTO, int maxRTO)
157 { 160 {
158 AgentID = agentID; 161 AgentID = agentID;
159 RemoteEndPoint = remoteEndPoint; 162 RemoteEndPoint = remoteEndPoint;
160 CircuitCode = circuitCode; 163 CircuitCode = circuitCode;
161 m_udpServer = server; 164 m_udpServer = server;
165 if (defaultRTO != 0)
166 m_defaultRTO = defaultRTO;
167 if (maxRTO != 0)
168 m_maxRTO = maxRTO;
169
162 // Create a token bucket throttle for this client that has the scene token bucket as a parent 170 // Create a token bucket throttle for this client that has the scene token bucket as a parent
163 m_throttle = new TokenBucket(parentThrottle, rates.TotalLimit, rates.Total); 171 m_throttle = new TokenBucket(parentThrottle, rates.TotalLimit, rates.Total);
164 // Create an array of token buckets for this clients different throttle categories 172 // Create an array of token buckets for this clients different throttle categories
@@ -175,7 +183,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
175 } 183 }
176 184
177 // Default the retransmission timeout to three seconds 185 // Default the retransmission timeout to three seconds
178 RTO = 3000; 186 RTO = m_defaultRTO;
179 187
180 // Initialize this to a sane value to prevent early disconnects 188 // Initialize this to a sane value to prevent early disconnects
181 TickLastPacketReceived = Environment.TickCount & Int32.MaxValue; 189 TickLastPacketReceived = Environment.TickCount & Int32.MaxValue;
@@ -497,7 +505,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
497 int rto = (int)(SRTT + Math.Max(m_udpServer.TickCountResolution, K * RTTVAR)); 505 int rto = (int)(SRTT + Math.Max(m_udpServer.TickCountResolution, K * RTTVAR));
498 506
499 // Clamp the retransmission timeout to manageable values 507 // Clamp the retransmission timeout to manageable values
500 rto = Utils.Clamp(RTO, 3000, 60000); 508 rto = Utils.Clamp(RTO, m_defaultRTO, m_maxRTO);
501 509
502 RTO = rto; 510 RTO = rto;
503 511
@@ -517,7 +525,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
517 RTTVAR = 0.0f; 525 RTTVAR = 0.0f;
518 526
519 // Double the retransmission timeout 527 // Double the retransmission timeout
520 RTO = Math.Min(RTO * 2, 60000); 528 RTO = Math.Min(RTO * 2, m_maxRTO);
521 } 529 }
522 530
523 /// <summary> 531 /// <summary>