OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
/// <summary>
/// Add tokens to the bucket over time. The number of tokens added each
/// call depends on the length of time that has passed since the last 
/// call to Drip
/// </summary>
/// <returns>True if tokens were added to the bucket, otherwise false</returns>
Add tokens to the bucket over time. The number of tokens added each
call depends on the length of time that has passed since the last
call to Drip
Add tokens to the bucket over time . The number of tokens added each call depends on the length of time that has passed since the last call to Drip
protected void Drip()
        {
            if (DripRate == 0)
            {
                m_log.WarnFormat("[TOKENBUCKET] something odd is happening and drip rate is 0 for {0}", Identifier);
                return;
            }
            Int32 deltaMS = Math.Min(Util.EnvironmentTickCountSubtract(m_lastDrip), m_ticksPerQuantum);
            m_lastDrip = Util.EnvironmentTickCount();
            if (deltaMS <= 0)
                return;
            Deposit(deltaMS * DripRate / m_ticksPerQuantum);
        }
protected void Drip ( ) { if ( DripRate == 0 ) { m_log . WarnFormat ( " " , Identifier ) ; return ; } Int32 deltaMS = Math . Min ( Util . EnvironmentTickCountSubtract ( m_lastDrip ) , m_ticksPerQuantum ) ; m_lastDrip = Util . EnvironmentTickCount ( ) ; if ( deltaMS <= 0 ) return ; Deposit ( deltaMS * DripRate / m_ticksPerQuantum ) ; }
Add tokens to the bucket over time.
Add tokens to the bucket over time .
// This should never happen... means we are a leaf node and were created // with no drip rate... // Determine the interval over which we are adding tokens, never add // more than a single quantum of tokens // This can be 0 in the very unusual case that the timer wrapped // It can be 0 if we try add tokens at a sub-tick rate
True if tokens were added to the bucket, otherwise false
True if tokens were added to the bucket otherwise false