From 54a912bb9cd5148abfa5eb68b0146ae3b04051a3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 1 Oct 2009 22:35:57 +0100 Subject: Add a method to determine the count of packets in a throttle --- .../ClientStack/LindenUDP/ILLPacketHandler.cs | 1 + .../Region/ClientStack/LindenUDP/LLPacketHandler.cs | 5 +++++ .../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/OpenSim/Region/ClientStack/LindenUDP/ILLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/ILLPacketHandler.cs index 5658dba..31f9580 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/ILLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/ILLPacketHandler.cs @@ -78,5 +78,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP void SetClientInfo(ClientInfo info); void AddImportantPacket(PacketType type); void RemoveImportantPacket(PacketType type); + int GetQueueCount(ThrottleOutPacketType queue); } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 801e0c5..37f6ca7 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs @@ -863,5 +863,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_PacketQueue.Close(); Thread.CurrentThread.Abort(); } + + public int GetQueueCount(ThrottleOutPacketType queue) + { + return m_PacketQueue.GetQueueCount(queue); + } } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index f08f1b6..d4d654f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -753,5 +753,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP { get { return throttleMultiplier; } } + + public int GetQueueCount(ThrottleOutPacketType queue) + { + switch (queue) + { + case ThrottleOutPacketType.Land: + return LandOutgoingPacketQueue.Count; + case ThrottleOutPacketType.Wind: + return WindOutgoingPacketQueue.Count; + case ThrottleOutPacketType.Cloud: + return CloudOutgoingPacketQueue.Count; + case ThrottleOutPacketType.Task: + return TaskOutgoingPacketQueue.Count; + case ThrottleOutPacketType.Texture: + return TextureOutgoingPacketQueue.Count; + case ThrottleOutPacketType.Asset: + return AssetOutgoingPacketQueue.Count; + } + + return 0; + } } } -- cgit v1.1