aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
index eaf8f60..37f6ca7 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
@@ -129,6 +129,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
129 // 129 //
130 public event PacketStats OnPacketStats; 130 public event PacketStats OnPacketStats;
131 public event PacketDrop OnPacketDrop; 131 public event PacketDrop OnPacketDrop;
132 public event QueueEmpty OnQueueEmpty;
132 133
133 134
134 //private SynchronizeClientHandler m_SynchronizeClient = null; 135 //private SynchronizeClientHandler m_SynchronizeClient = null;
@@ -172,13 +173,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
172 173
173 m_PacketQueue = new LLPacketQueue(client.AgentId, userSettings); 174 m_PacketQueue = new LLPacketQueue(client.AgentId, userSettings);
174 175
176 m_PacketQueue.OnQueueEmpty += TriggerOnQueueEmpty;
177
175 m_AckTimer.Elapsed += AckTimerElapsed; 178 m_AckTimer.Elapsed += AckTimerElapsed;
176 m_AckTimer.Start(); 179 m_AckTimer.Start();
177 } 180 }
178 181
179 public void Stop() 182 public void Dispose()
180 { 183 {
181 m_AckTimer.Stop(); 184 m_AckTimer.Stop();
185 m_AckTimer.Close();
182 186
183 m_PacketQueue.Enqueue(null); 187 m_PacketQueue.Enqueue(null);
184 m_PacketQueue.Close(); 188 m_PacketQueue.Close();
@@ -768,6 +772,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
768 handlerPacketDrop(packet, id); 772 handlerPacketDrop(packet, id);
769 } 773 }
770 774
775 private void TriggerOnQueueEmpty(ThrottleOutPacketType queue)
776 {
777 QueueEmpty handlerQueueEmpty = OnQueueEmpty;
778
779 if (handlerQueueEmpty == null)
780 return;
781
782 handlerQueueEmpty(queue);
783 }
784
771 // Convert the packet to bytes and stuff it onto the send queue 785 // Convert the packet to bytes and stuff it onto the send queue
772 // 786 //
773 public void ProcessOutPacket(LLQueItem item) 787 public void ProcessOutPacket(LLQueItem item)
@@ -849,5 +863,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
849 m_PacketQueue.Close(); 863 m_PacketQueue.Close();
850 Thread.CurrentThread.Abort(); 864 Thread.CurrentThread.Abort();
851 } 865 }
866
867 public int GetQueueCount(ThrottleOutPacketType queue)
868 {
869 return m_PacketQueue.GetQueueCount(queue);
870 }
852 } 871 }
853} 872}