diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index dc8ac3c41c..9449ffb9dc 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs @@ -111,6 +111,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// hooked to put more data on the empty queue public event QueueEmpty OnQueueEmpty; + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design","CA1009:DeclareEventHandlersCorrectly")] public event Func HasUpdates; /// AgentID for this client diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index af33d17b7e..a868e3aa44 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -521,7 +521,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // if (usePools) // EnablePools(); - DisablePools(); + base.DisablePools(); } public void Start() diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs index 7171974db3..4d726b43dd 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs @@ -179,6 +179,11 @@ namespace OpenMetaverse // m_dropRandomGenerator = new Random(); } + ~OpenSimUDPBase() + { + if(m_udpSocket !=null) + try { m_udpSocket.Close(); } catch { } + } /// /// Start inbound UDP packet handling. /// diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs index d4603f80a5..cac57b221e 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs @@ -97,7 +97,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// protected float m_burst; - public virtual float MaxDripRate { get; set; } + protected float m_maxDripRate = 0; + public virtual float MaxDripRate + { + get { return m_maxDripRate; } + set { m_maxDripRate = value; } + } public float RequestedBurst { @@ -134,7 +139,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// the system tick interval (typically around 15-22ms) protected float m_dripRate; - public virtual float RequestedDripRate + public float RequestedDripRate { get { return (m_dripRate == 0 ? m_totalDripRequest : m_dripRate); } set { @@ -146,7 +151,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } - public virtual float DripRate + public float DripRate { get { float rate = Math.Min(RequestedDripRate,TotalDripRequest); @@ -344,7 +349,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP // greater than this. // - protected float m_maxDripRate = 0; public override float MaxDripRate { get { return (m_maxDripRate == 0 ? m_totalDripRequest : m_maxDripRate); } @@ -359,7 +363,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // // Adjust drip rate in response to network conditions. // - public virtual float AdjustedDripRate + public float AdjustedDripRate { get { return m_dripRate; } set @@ -380,12 +384,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP { m_enabled = enabled; - MaxDripRate = maxDripRate; + m_maxDripRate = (maxDripRate == 0 ? m_totalDripRequest : Math.Max(maxDripRate, m_minimumFlow)); if (enabled) - AdjustedDripRate = m_maxDripRate * .5f; + m_dripRate = m_maxDripRate * .5f; else - AdjustedDripRate = m_maxDripRate; + m_dripRate = m_maxDripRate; + if (m_parent != null) + m_parent.RegisterRequest(this, m_dripRate); } ///