diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Region/ClientStack/Linden/UDP/UnackedPacketCollection.cs | |
parent | Add a build script. (diff) | |
download | opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/UnackedPacketCollection.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/UnackedPacketCollection.cs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/Linden/UDP/UnackedPacketCollection.cs index b546a99..76f4c6f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/UnackedPacketCollection.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/UnackedPacketCollection.cs | |||
@@ -74,6 +74,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
74 | /// <summary>Holds information about pending removals</summary> | 74 | /// <summary>Holds information about pending removals</summary> |
75 | private LocklessQueue<uint> m_pendingRemoves = new LocklessQueue<uint>(); | 75 | private LocklessQueue<uint> m_pendingRemoves = new LocklessQueue<uint>(); |
76 | 76 | ||
77 | |||
78 | public void Clear() | ||
79 | { | ||
80 | m_packets.Clear(); | ||
81 | m_pendingAdds = null; | ||
82 | m_pendingAcknowledgements = null; | ||
83 | m_pendingRemoves = null; | ||
84 | } | ||
85 | |||
77 | /// <summary> | 86 | /// <summary> |
78 | /// Add an unacked packet to the collection | 87 | /// Add an unacked packet to the collection |
79 | /// </summary> | 88 | /// </summary> |
@@ -85,7 +94,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
85 | public void Add(OutgoingPacket packet) | 94 | public void Add(OutgoingPacket packet) |
86 | { | 95 | { |
87 | m_pendingAdds.Enqueue(packet); | 96 | m_pendingAdds.Enqueue(packet); |
88 | Interlocked.Add(ref packet.Client.UnackedBytes, packet.Buffer.DataLength); | 97 | Interlocked.Add(ref packet.Client.UnackedBytes, packet.Buffer.DataLength); |
89 | } | 98 | } |
90 | 99 | ||
91 | /// <summary> | 100 | /// <summary> |
@@ -107,7 +116,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
107 | /// <summary> | 116 | /// <summary> |
108 | /// Marks a packet as no longer needing acknowledgement without a received acknowledgement. | 117 | /// Marks a packet as no longer needing acknowledgement without a received acknowledgement. |
109 | /// This method is called when a packet expires and we no longer need an acknowledgement. | 118 | /// This method is called when a packet expires and we no longer need an acknowledgement. |
110 | /// When some reliable packet types expire, they are handled in a way other than simply | 119 | /// When some reliable packet types expire, they are handled in a way other than simply |
111 | /// resending them. The only effect of removal this way is to update unacked byte count. | 120 | /// resending them. The only effect of removal this way is to update unacked byte count. |
112 | /// </summary> | 121 | /// </summary> |
113 | /// <param name="sequenceNumber">Sequence number of the packet to | 122 | /// <param name="sequenceNumber">Sequence number of the packet to |
@@ -146,7 +155,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
146 | 155 | ||
147 | foreach (OutgoingPacket packet in m_packets.Values) | 156 | foreach (OutgoingPacket packet in m_packets.Values) |
148 | { | 157 | { |
149 | // TickCount of zero means a packet is in the resend queue | 158 | // TickCount of zero means a packet is in the resend queue |
150 | // but hasn't actually been sent over the wire yet | 159 | // but hasn't actually been sent over the wire yet |
151 | if (packet.TickCount == 0) | 160 | if (packet.TickCount == 0) |
152 | continue; | 161 | continue; |
@@ -163,7 +172,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
163 | // As with other network applications, assume that an expired packet is | 172 | // As with other network applications, assume that an expired packet is |
164 | // an indication of some network problem, slow transmission | 173 | // an indication of some network problem, slow transmission |
165 | packet.Client.FlowThrottle.ExpirePackets(1); | 174 | packet.Client.FlowThrottle.ExpirePackets(1); |
166 | 175 | ||
167 | expiredPackets.Add(packet); | 176 | expiredPackets.Add(packet); |
168 | } | 177 | } |
169 | } | 178 | } |
@@ -182,7 +191,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
182 | while (m_pendingAdds.TryDequeue(out pendingAdd)) | 191 | while (m_pendingAdds.TryDequeue(out pendingAdd)) |
183 | if (pendingAdd != null) | 192 | if (pendingAdd != null) |
184 | m_packets[pendingAdd.SequenceNumber] = pendingAdd; | 193 | m_packets[pendingAdd.SequenceNumber] = pendingAdd; |
185 | 194 | ||
186 | // Process all the pending removes, including updating statistics and round-trip times | 195 | // Process all the pending removes, including updating statistics and round-trip times |
187 | PendingAck pendingAcknowledgement; | 196 | PendingAck pendingAcknowledgement; |
188 | while (m_pendingAcknowledgements.TryDequeue(out pendingAcknowledgement)) | 197 | while (m_pendingAcknowledgements.TryDequeue(out pendingAcknowledgement)) |
@@ -219,7 +228,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
219 | else | 228 | else |
220 | { | 229 | { |
221 | // m_log.WarnFormat("[UNACKED PACKET COLLECTION]: Could not find packet with sequence number {0} to ack", | 230 | // m_log.WarnFormat("[UNACKED PACKET COLLECTION]: Could not find packet with sequence number {0} to ack", |
222 | // pendingAcknowledgement.SequenceNumber); | 231 | // pendingAcknowledgement.SequenceNumber); |
223 | } | 232 | } |
224 | } | 233 | } |
225 | 234 | ||