diff options
author | Justin Clarke Casey | 2008-10-01 20:54:28 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-01 20:54:28 +0000 |
commit | cbb9693ef4f5fe10251ebe04ca7de7f6e65d2893 (patch) | |
tree | 2967a530c266c54748d8547490b6ab8da6f053d8 | |
parent | * refactor: rename interface to put standard I prefix in front (diff) | |
download | opensim-SC_OLD-cbb9693ef4f5fe10251ebe04ca7de7f6e65d2893.zip opensim-SC_OLD-cbb9693ef4f5fe10251ebe04ca7de7f6e65d2893.tar.gz opensim-SC_OLD-cbb9693ef4f5fe10251ebe04ca7de7f6e65d2893.tar.bz2 opensim-SC_OLD-cbb9693ef4f5fe10251ebe04ca7de7f6e65d2893.tar.xz |
* Try bumping packet resend timeout up to 2 seconds instead of 1
* This actually probably doesn't make a huge difference. We still end up resending a massive number of packets in quite a few situations, but it's not easy to consistently
reproduce this.
* Might really need some throttling of packet send to the client on the OpenSim end.
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 0608b7f..ca0882d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs | |||
@@ -78,8 +78,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
78 | 78 | ||
79 | public class LLPacketHandler : IPacketHandler | 79 | public class LLPacketHandler : IPacketHandler |
80 | { | 80 | { |
81 | //private static readonly ILog m_log = | 81 | private static readonly ILog m_log |
82 | // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 82 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
83 | |||
84 | private int m_resentCount; | ||
83 | 85 | ||
84 | // Packet queues | 86 | // Packet queues |
85 | // | 87 | // |
@@ -117,7 +119,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
117 | private Dictionary<uint, AckData> m_NeedAck = | 119 | private Dictionary<uint, AckData> m_NeedAck = |
118 | new Dictionary<uint, AckData>(); | 120 | new Dictionary<uint, AckData>(); |
119 | 121 | ||
120 | private uint m_ResendTimeout = 1000; | 122 | /// <summary> |
123 | /// The number of milliseconds that can pass before a packet that needs an ack is resent. | ||
124 | /// </param> | ||
125 | private uint m_ResendTimeout = 2000; | ||
121 | 126 | ||
122 | public uint ResendTimeout | 127 | public uint ResendTimeout |
123 | { | 128 | { |
@@ -125,7 +130,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
125 | set { m_ResendTimeout = value; } | 130 | set { m_ResendTimeout = value; } |
126 | } | 131 | } |
127 | 132 | ||
128 | private uint m_DiscardTimeout = 8000; | 133 | /// <summary> |
134 | /// The number of milliseconds that can pass before a packet that needs an ack is discarded instead. | ||
135 | /// </summary> | ||
136 | private uint m_DiscardTimeout = 16000; | ||
129 | 137 | ||
130 | public uint DiscardTimeout | 138 | public uint DiscardTimeout |
131 | { | 139 | { |
@@ -357,8 +365,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
357 | // Resend the packet. Set the packet's tick count to | 365 | // Resend the packet. Set the packet's tick count to |
358 | // now, and keep it marked as resent. | 366 | // now, and keep it marked as resent. |
359 | //m_log.DebugFormat( | 367 | //m_log.DebugFormat( |
360 | // "[CLIENT]: Resending unacked packet number {0} after {1}ms", | 368 | // "[CLIENT]: In {0} resending unacked packet {1} after {2}ms", |
361 | // packet.Header.Sequence, now - data.TickCount); | 369 | // m_Client.Scene.RegionInfo.ExternalEndPoint.Port, packet.Header.Sequence, now - data.TickCount); |
370 | //m_log.DebugFormat("[CLIENT]: Resent {0} packets in total", ++m_resentCount); | ||
362 | 371 | ||
363 | packet.Header.Resent = true; | 372 | packet.Header.Resent = true; |
364 | QueuePacket(packet, ThrottleOutPacketType.Resend, | 373 | QueuePacket(packet, ThrottleOutPacketType.Resend, |
@@ -380,8 +389,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
380 | m_NeedAck.Remove(packet.Header.Sequence); | 389 | m_NeedAck.Remove(packet.Header.Sequence); |
381 | 390 | ||
382 | //m_log.DebugFormat( | 391 | //m_log.DebugFormat( |
383 | // "[CLIENT]: Discarding ack requirement for packet number {0}", | 392 | // "[CLIENT]: In {0} discarding ack requirement for packet {1}", |
384 | // packet.Header.Sequence); | 393 | // m_Client.Scene.RegionInfo.ExternalEndPoint.Port, packet.Header.Sequence); |
385 | } | 394 | } |
386 | 395 | ||
387 | TriggerOnPacketDrop(packet, data.Identifier); | 396 | TriggerOnPacketDrop(packet, data.Identifier); |
@@ -621,7 +630,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
621 | 630 | ||
622 | lock (m_NeedAck) | 631 | lock (m_NeedAck) |
623 | { | 632 | { |
624 | //m_log.DebugFormat("[CLIENT]: Received ack for packet sequence number {0}", id); | 633 | //m_log.DebugFormat("[CLIENT]: In {0} received ack for packet {1}", m_Client.Scene.RegionInfo.ExternalEndPoint.Port, id); |
625 | 634 | ||
626 | if (!m_NeedAck.TryGetValue(id, out data)) | 635 | if (!m_NeedAck.TryGetValue(id, out data)) |
627 | return; | 636 | return; |
@@ -780,6 +789,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
780 | // Actually make the byte array and send it | 789 | // Actually make the byte array and send it |
781 | byte[] sendbuffer = packet.ToBytes(); | 790 | byte[] sendbuffer = packet.ToBytes(); |
782 | 791 | ||
792 | //m_log.DebugFormat( | ||
793 | // "[CLIENT]: In {0} sending packet {1}", | ||
794 | // m_Client.Scene.RegionInfo.ExternalEndPoint.Port, packet.Header.Sequence); | ||
795 | |||
783 | if (packet.Header.Zerocoded) | 796 | if (packet.Header.Zerocoded) |
784 | { | 797 | { |
785 | int packetsize = Helpers.ZeroEncode(sendbuffer, | 798 | int packetsize = Helpers.ZeroEncode(sendbuffer, |