diff options
author | Teravus Ovares (Dan Olivares) | 2009-10-30 19:25:41 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-10-30 19:25:41 -0400 |
commit | 50b599a62b362df32dd8cc7258904f40280d4d69 (patch) | |
tree | ff54bc40c0564498112d5068fb6422f6c37a27ab /OpenSim/Region | |
parent | * Remove the locklessqueue tests since I guess I didn't understand what it wa... (diff) | |
parent | Merge branch 'master' of ssh://melanie@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-50b599a62b362df32dd8cc7258904f40280d4d69.zip opensim-SC-50b599a62b362df32dd8cc7258904f40280d4d69.tar.gz opensim-SC-50b599a62b362df32dd8cc7258904f40280d4d69.tar.bz2 opensim-SC-50b599a62b362df32dd8cc7258904f40280d4d69.tar.xz |
Merge branch 'master' of ssh://MyConnection/var/git/opensim
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 8 |
2 files changed, 19 insertions, 5 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> |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 6f94921..93946ae 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -153,6 +153,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
153 | /// <summary>Flag to signal when clients should send pings</summary> | 153 | /// <summary>Flag to signal when clients should send pings</summary> |
154 | private bool m_sendPing; | 154 | private bool m_sendPing; |
155 | 155 | ||
156 | private int m_defaultRTO = 0; | ||
157 | private int m_maxRTO = 0; | ||
158 | |||
156 | public Socket Server { get { return null; } } | 159 | public Socket Server { get { return null; } } |
157 | 160 | ||
158 | public LLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) | 161 | public LLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) |
@@ -189,6 +192,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
189 | AvatarTerseUpdatesPerPacket = config.GetInt("AvatarTerseUpdatesPerPacket", 10); | 192 | AvatarTerseUpdatesPerPacket = config.GetInt("AvatarTerseUpdatesPerPacket", 10); |
190 | PrimFullUpdatesPerPacket = config.GetInt("PrimFullUpdatesPerPacket", 100); | 193 | PrimFullUpdatesPerPacket = config.GetInt("PrimFullUpdatesPerPacket", 100); |
191 | TextureSendLimit = config.GetInt("TextureSendLimit", 20); | 194 | TextureSendLimit = config.GetInt("TextureSendLimit", 20); |
195 | |||
196 | m_defaultRTO = config.GetInt("DefaultRTO", 0); | ||
197 | m_maxRTO = config.GetInt("MaxRTO", 0); | ||
192 | } | 198 | } |
193 | else | 199 | else |
194 | { | 200 | { |
@@ -766,7 +772,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
766 | protected virtual void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo) | 772 | protected virtual void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo) |
767 | { | 773 | { |
768 | // Create the LLUDPClient | 774 | // Create the LLUDPClient |
769 | LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint); | 775 | LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); |
770 | IClientAPI existingClient; | 776 | IClientAPI existingClient; |
771 | 777 | ||
772 | if (!m_scene.TryGetClient(agentID, out existingClient)) | 778 | if (!m_scene.TryGetClient(agentID, out existingClient)) |