aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMelanie Thielker2008-07-22 17:58:42 +0000
committerMelanie Thielker2008-07-22 17:58:42 +0000
commitf112cebde2c1bc06108839acac82bc8addd7c506 (patch)
tree7f1e7fabf2fec74171d5982f09d847b47e20d7ca /OpenSim/Framework
parent* refactor: move new inventory service call by user server to OGS1 with all t... (diff)
downloadopensim-SC-f112cebde2c1bc06108839acac82bc8addd7c506.zip
opensim-SC-f112cebde2c1bc06108839acac82bc8addd7c506.tar.gz
opensim-SC-f112cebde2c1bc06108839acac82bc8addd7c506.tar.bz2
opensim-SC-f112cebde2c1bc06108839acac82bc8addd7c506.tar.xz
Refactor the packet scheduling out of ClientView. Add intelligent
resending, timeouts, packet discarding. Add notification event for packet discarding. Add priority scheduling for packet queues. Add outgoing duplicate detection facility. Correct packet sequencing. Make provisions for automatic server side throttle adjustments (comes in next installment)
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/BlockingQueue.cs20
-rw-r--r--OpenSim/Framework/IClientAPI.cs12
-rw-r--r--OpenSim/Framework/ThrottleOutPacketType.cs5
3 files changed, 26 insertions, 11 deletions
diff --git a/OpenSim/Framework/BlockingQueue.cs b/OpenSim/Framework/BlockingQueue.cs
index 345b361..5b7e911 100644
--- a/OpenSim/Framework/BlockingQueue.cs
+++ b/OpenSim/Framework/BlockingQueue.cs
@@ -32,9 +32,19 @@ namespace OpenSim.Framework
32{ 32{
33 public class BlockingQueue<T> 33 public class BlockingQueue<T>
34 { 34 {
35 private readonly Queue<T> m_pqueue = new Queue<T>();
35 private readonly Queue<T> m_queue = new Queue<T>(); 36 private readonly Queue<T> m_queue = new Queue<T>();
36 private readonly object m_queueSync = new object(); 37 private readonly object m_queueSync = new object();
37 38
39 public void PriorityEnqueue(T value)
40 {
41 lock (m_queueSync)
42 {
43 m_pqueue.Enqueue(value);
44 Monitor.Pulse(m_queueSync);
45 }
46 }
47
38 public void Enqueue(T value) 48 public void Enqueue(T value)
39 { 49 {
40 lock (m_queueSync) 50 lock (m_queueSync)
@@ -48,11 +58,13 @@ namespace OpenSim.Framework
48 { 58 {
49 lock (m_queueSync) 59 lock (m_queueSync)
50 { 60 {
51 if (m_queue.Count < 1) 61 if (m_queue.Count < 1 && m_pqueue.Count < 1)
52 { 62 {
53 Monitor.Wait(m_queueSync); 63 Monitor.Wait(m_queueSync);
54 } 64 }
55 65
66 if(m_pqueue.Count > 0)
67 return m_pqueue.Dequeue();
56 return m_queue.Dequeue(); 68 return m_queue.Dequeue();
57 } 69 }
58 } 70 }
@@ -61,6 +73,8 @@ namespace OpenSim.Framework
61 { 73 {
62 lock (m_queueSync) 74 lock (m_queueSync)
63 { 75 {
76 if(m_pqueue.Contains(item))
77 return true;
64 return m_queue.Contains(item); 78 return m_queue.Contains(item);
65 } 79 }
66 } 80 }
@@ -69,7 +83,7 @@ namespace OpenSim.Framework
69 { 83 {
70 lock (m_queueSync) 84 lock (m_queueSync)
71 { 85 {
72 return m_queue.Count; 86 return m_queue.Count+m_pqueue.Count;
73 } 87 }
74 } 88 }
75 89
@@ -81,4 +95,4 @@ namespace OpenSim.Framework
81 } 95 }
82 } 96 }
83 } 97 }
84} \ No newline at end of file 98}
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index a835598..b1f62f1 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -254,8 +254,6 @@ namespace OpenSim.Framework
254 254
255 public delegate void FriendshipTermination(IClientAPI remoteClient, LLUUID agentID, LLUUID ExID); 255 public delegate void FriendshipTermination(IClientAPI remoteClient, LLUUID agentID, LLUUID ExID);
256 256
257 public delegate void PacketStats(int inPackets, int outPackets, int unAckedBytes);
258
259 public delegate void MoneyTransferRequest(LLUUID sourceID, LLUUID destID, int amount, int transactionType, string description); 257 public delegate void MoneyTransferRequest(LLUUID sourceID, LLUUID destID, int amount, int transactionType, string description);
260 258
261 public delegate void ParcelBuy(LLUUID agentId, LLUUID groupId, bool final, bool groupOwned, 259 public delegate void ParcelBuy(LLUUID agentId, LLUUID groupId, bool final, bool groupOwned,
@@ -324,6 +322,8 @@ namespace OpenSim.Framework
324 322
325 string LastName { get; } 323 string LastName { get; }
326 324
325 IScene Scene { get; }
326
327 // [Obsolete("LLClientView Specific - Replace with ???")] 327 // [Obsolete("LLClientView Specific - Replace with ???")]
328 int NextAnimationSequenceNumber { get; } 328 int NextAnimationSequenceNumber { get; }
329 329
@@ -460,7 +460,6 @@ namespace OpenSim.Framework
460 event FriendActionDelegate OnApproveFriendRequest; 460 event FriendActionDelegate OnApproveFriendRequest;
461 event FriendActionDelegate OnDenyFriendRequest; 461 event FriendActionDelegate OnDenyFriendRequest;
462 event FriendshipTermination OnTerminateFriendship; 462 event FriendshipTermination OnTerminateFriendship;
463 event PacketStats OnPacketStats;
464 463
465 // Financial packets 464 // Financial packets
466 event MoneyTransferRequest OnMoneyTransferRequest; 465 event MoneyTransferRequest OnMoneyTransferRequest;
@@ -526,7 +525,6 @@ namespace OpenSim.Framework
526 525
527 void SendLayerData(float[] map); 526 void SendLayerData(float[] map);
528 void SendLayerData(int px, int py, float[] map); 527 void SendLayerData(int px, int py, float[] map);
529 void SendLayerData(int px, int py, float[] map, bool track);
530 528
531 void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look); 529 void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look);
532 void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint); 530 void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint);
@@ -561,13 +559,14 @@ namespace OpenSim.Framework
561 LLVector3 pos, LLVector3 vel, LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, 559 LLVector3 pos, LLVector3 vel, LLVector3 acc, LLQuaternion rotation, LLVector3 rvel,
562 uint flags, 560 uint flags,
563 LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, 561 LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem,
564 byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint, LLUUID AssetId, LLUUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius, bool track); 562 byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint, LLUUID AssetId, LLUUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius);
565 563
566 564
567 void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, 565 void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
568 LLVector3 pos, LLVector3 vel, LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, 566 LLVector3 pos, LLVector3 vel, LLVector3 acc, LLQuaternion rotation, LLVector3 rvel,
569 uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color, 567 uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color,
570 uint parentID, byte[] particleSystem, byte clickAction, bool track); 568 uint parentID, byte[] particleSystem, byte clickAction);
569
571 570
572 void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, 571 void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
573 LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity, byte state, LLUUID AssetId); 572 LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity, byte state, LLUUID AssetId);
@@ -703,6 +702,7 @@ namespace OpenSim.Framework
703 702
704 void SetDebug(int newDebug); 703 void SetDebug(int newDebug);
705 void InPacket(Packet NewPack); 704 void InPacket(Packet NewPack);
705 void ProcessInPacket(Packet NewPack);
706 void Close(bool ShutdownCircuit); 706 void Close(bool ShutdownCircuit);
707 void Kick(string message); 707 void Kick(string message);
708 void Stop(); 708 void Stop();
diff --git a/OpenSim/Framework/ThrottleOutPacketType.cs b/OpenSim/Framework/ThrottleOutPacketType.cs
index e045783..27b25d2 100644
--- a/OpenSim/Framework/ThrottleOutPacketType.cs
+++ b/OpenSim/Framework/ThrottleOutPacketType.cs
@@ -10,6 +10,7 @@ namespace OpenSim.Framework
10 Texture = 5, 10 Texture = 5,
11 Asset = 6, 11 Asset = 6,
12 Unknown = 7, // Also doubles as 'do not throttle' 12 Unknown = 7, // Also doubles as 'do not throttle'
13 Back = 8 13 Back = 8,
14 LowpriorityTask = 9
14 } 15 }
15} \ No newline at end of file 16}