aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs28
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>