diff options
author | Dan Lake | 2011-04-21 01:51:08 -0700 |
---|---|---|
committer | Dan Lake | 2011-04-21 01:51:08 -0700 |
commit | 3640d0204f77dff3b1c4bd50229b60a49d2745e5 (patch) | |
tree | 31c6568e707ab1157d9fc0fd4a34da010a0c9bd5 /OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs | |
parent | bug fix. Now when an unacked update packet is handled through ResendPrimUpdat... (diff) | |
download | opensim-SC-3640d0204f77dff3b1c4bd50229b60a49d2745e5.zip opensim-SC-3640d0204f77dff3b1c4bd50229b60a49d2745e5.tar.gz opensim-SC-3640d0204f77dff3b1c4bd50229b60a49d2745e5.tar.bz2 opensim-SC-3640d0204f77dff3b1c4bd50229b60a49d2745e5.tar.xz |
Added ability to remove unacked packet from UnackedPacketCollection without an acknowledgement from the network. This prevents RTT and throttles from being updated as they would when an ACK is actually received. Also fixed stats logging for unacked bytes and resent packets in this case.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs index b170964..90a87fa 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs | |||
@@ -83,6 +83,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
83 | 83 | ||
84 | /// <summary> | 84 | /// <summary> |
85 | /// Marks a packet as acknowledged | 85 | /// Marks a packet as acknowledged |
86 | /// This method is used when an acknowledgement is received from the network for a previously | ||
87 | /// sent packet. Effects of removal this way are to update unacked byte count, adjust RTT | ||
88 | /// and increase throttle to the coresponding client. | ||
86 | /// </summary> | 89 | /// </summary> |
87 | /// <param name="sequenceNumber">Sequence number of the packet to | 90 | /// <param name="sequenceNumber">Sequence number of the packet to |
88 | /// acknowledge</param> | 91 | /// acknowledge</param> |
@@ -95,6 +98,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
95 | } | 98 | } |
96 | 99 | ||
97 | /// <summary> | 100 | /// <summary> |
101 | /// Marks a packet as no longer needing acknowledgement without a received acknowledgement. | ||
102 | /// This method is called when a packet expires and we no longer need an acknowledgement. | ||
103 | /// When some reliable packet types expire, they are handled in a way other than simply | ||
104 | /// resending them. The only effect of removal this way is to update unacked byte count. | ||
105 | /// </summary> | ||
106 | /// <param name="sequenceNumber">Sequence number of the packet to | ||
107 | /// acknowledge</param> | ||
108 | /// <remarks>The packet is removed from the collection immediately. | ||
109 | /// This function is not threadsafe. It must be called by the thread calling GetExpiredPackets.</remarks> | ||
110 | public void Remove(uint sequenceNumber) | ||
111 | { | ||
112 | OutgoingPacket removedPacket; | ||
113 | if (m_packets.TryGetValue(sequenceNumber, out removedPacket)) | ||
114 | { | ||
115 | if (removedPacket != null) | ||
116 | { | ||
117 | m_packets.Remove(sequenceNumber); | ||
118 | |||
119 | // Update stats | ||
120 | Interlocked.Add(ref removedPacket.Client.UnackedBytes, -removedPacket.Buffer.DataLength); | ||
121 | } | ||
122 | } | ||
123 | } | ||
124 | |||
125 | /// <summary> | ||
98 | /// Returns a list of all of the packets with a TickCount older than | 126 | /// Returns a list of all of the packets with a TickCount older than |
99 | /// the specified timeout | 127 | /// the specified timeout |
100 | /// </summary> | 128 | /// </summary> |