diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index b11a80d..f2b8720 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -89,6 +89,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
89 | /// </summary> | 89 | /// </summary> |
90 | public class LLUDPServer : OpenSimUDPBase | 90 | public class LLUDPServer : OpenSimUDPBase |
91 | { | 91 | { |
92 | /// <summary>Maximum transmission unit, or UDP packet size, for the LLUDP protocol</summary> | ||
93 | public const int MTU = 1400; | ||
94 | |||
92 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 95 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
93 | 96 | ||
94 | /// <summary>Handlers for incoming packets</summary> | 97 | /// <summary>Handlers for incoming packets</summary> |
@@ -272,7 +275,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
272 | // The vast majority of packets are less than 200 bytes, although due to asset transfers and packet splitting | 275 | // The vast majority of packets are less than 200 bytes, although due to asset transfers and packet splitting |
273 | // there are a decent number of packets in the 1000-1140 byte range. We allocate one of two sizes of data here | 276 | // there are a decent number of packets in the 1000-1140 byte range. We allocate one of two sizes of data here |
274 | // to accomodate for both common scenarios and provide ample room for ACK appending in both | 277 | // to accomodate for both common scenarios and provide ample room for ACK appending in both |
275 | int bufferSize = (dataLength > 180) ? Packet.MTU : 200; | 278 | int bufferSize = (dataLength > 180) ? LLUDPServer.MTU : 200; |
276 | 279 | ||
277 | UDPPacketBuffer buffer = new UDPPacketBuffer(udpClient.RemoteEndPoint, bufferSize); | 280 | UDPPacketBuffer buffer = new UDPPacketBuffer(udpClient.RemoteEndPoint, bufferSize); |
278 | 281 | ||
@@ -569,9 +572,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
569 | // client.BytesSinceLastACK. Lockless thread safety | 572 | // client.BytesSinceLastACK. Lockless thread safety |
570 | int bytesSinceLastACK = Interlocked.Exchange(ref udpClient.BytesSinceLastACK, 0); | 573 | int bytesSinceLastACK = Interlocked.Exchange(ref udpClient.BytesSinceLastACK, 0); |
571 | bytesSinceLastACK += buffer.DataLength; | 574 | bytesSinceLastACK += buffer.DataLength; |
572 | if (bytesSinceLastACK > Packet.MTU * 2) | 575 | if (bytesSinceLastACK > LLUDPServer.MTU * 2) |
573 | { | 576 | { |
574 | bytesSinceLastACK -= Packet.MTU * 2; | 577 | bytesSinceLastACK -= LLUDPServer.MTU * 2; |
575 | SendAcks(udpClient); | 578 | SendAcks(udpClient); |
576 | } | 579 | } |
577 | Interlocked.Add(ref udpClient.BytesSinceLastACK, bytesSinceLastACK); | 580 | Interlocked.Add(ref udpClient.BytesSinceLastACK, bytesSinceLastACK); |