aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-02 13:16:41 +0000
committerMelanie Thielker2009-05-02 13:16:41 +0000
commit62bcf0e69405ee1443f66eecd1f3fbd684f0c2a5 (patch)
tree24a887f787545c95fcc721cf41ac8c9b17d1ef85 /OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
parentAlso add these packet to the list of packets to be recycled. No enabled (diff)
downloadopensim-SC_OLD-62bcf0e69405ee1443f66eecd1f3fbd684f0c2a5.zip
opensim-SC_OLD-62bcf0e69405ee1443f66eecd1f3fbd684f0c2a5.tar.gz
opensim-SC_OLD-62bcf0e69405ee1443f66eecd1f3fbd684f0c2a5.tar.bz2
opensim-SC_OLD-62bcf0e69405ee1443f66eecd1f3fbd684f0c2a5.tar.xz
Numerous packet improvements.
Don't allow packets to be resent before they have actually been sent for the first time. Switch from serializing a packet to get it's length to the LibOMV provided Length property. Fix resend timing. Fix the use of dangling references to Acked packets. Fix the packet handler to play nice with the packet pool. Fix the packet pool. Add data block recycling to the packet pool. Packet pool is now ENABLED by default. Add config option to disable packet and data block reuse. Add ObjectUpdate and ImprovedTerseObjectUpdate to the packets being recycled.
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs25
1 files changed, 24 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
index ef1f34a..46d5610 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
@@ -83,6 +83,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
83 internal LLPacketThrottle TextureThrottle; 83 internal LLPacketThrottle TextureThrottle;
84 internal LLPacketThrottle TotalThrottle; 84 internal LLPacketThrottle TotalThrottle;
85 85
86 private List<uint> contents = new List<uint>();
87
86 /// <summary> 88 /// <summary>
87 /// The number of packets in the OutgoingPacketQueue 89 /// The number of packets in the OutgoingPacketQueue
88 /// 90 ///
@@ -186,6 +188,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
186 return; 188 return;
187 } 189 }
188 190
191 if (item.Sequence != 0)
192 contents.Add(item.Sequence);
193
189 lock (this) 194 lock (this)
190 { 195 {
191 switch (item.throttleType & ThrottleOutPacketType.TypeMask) 196 switch (item.throttleType & ThrottleOutPacketType.TypeMask)
@@ -226,7 +231,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
226 231
227 public LLQueItem Dequeue() 232 public LLQueItem Dequeue()
228 { 233 {
229 return SendQueue.Dequeue(); 234 while (true)
235 {
236 LLQueItem item = SendQueue.Dequeue();
237 if (item == null)
238 return null;
239 if (item.Incoming)
240 return item;
241 if (item.Sequence == 0)
242 return item;
243 if (contents.Remove(item.Sequence))
244 return item;
245 }
246 }
247
248 public void Cancel(uint sequence)
249 {
250 while(contents.Remove(sequence))
251 ;
230 } 252 }
231 253
232 public void Flush() 254 public void Flush()
@@ -286,6 +308,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
286 TextureOutgoingPacketQueue.Clear(); 308 TextureOutgoingPacketQueue.Clear();
287 AssetOutgoingPacketQueue.Clear(); 309 AssetOutgoingPacketQueue.Clear();
288 SendQueue.Clear(); 310 SendQueue.Clear();
311 contents.Clear();
289 } 312 }
290 } 313 }
291 314