change the clock source on tokenBucket
parent
6c44dceced
commit
92984556e1
|
@ -62,8 +62,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected const float m_minimumDripRate = 1500;
|
protected const float m_minimumDripRate = 1500;
|
||||||
|
|
||||||
/// <summary>Time of the last drip, in system ticks</summary>
|
/// <summary>Time of the last drip</summary>
|
||||||
protected Int32 m_lastDrip;
|
protected double m_lastDrip;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The number of bytes that can be sent at this moment. This is the
|
/// The number of bytes that can be sent at this moment. This is the
|
||||||
|
@ -166,10 +166,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected float m_totalDripRequest;
|
protected float m_totalDripRequest;
|
||||||
public float TotalDripRequest
|
public float TotalDripRequest
|
||||||
{
|
{
|
||||||
get { return m_totalDripRequest; }
|
get { return m_totalDripRequest; }
|
||||||
set { m_totalDripRequest = value; }
|
set { m_totalDripRequest = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Properties
|
#endregion Properties
|
||||||
|
|
||||||
|
@ -193,9 +193,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
Parent = parent;
|
Parent = parent;
|
||||||
RequestedDripRate = dripRate;
|
RequestedDripRate = dripRate;
|
||||||
RequestedBurst = MaxBurst;
|
RequestedBurst = MaxBurst;
|
||||||
// TotalDripRequest = dripRate; // this will be overwritten when a child node registers
|
m_lastDrip = Util.GetTimeStampMS() + 50.0;
|
||||||
// MaxBurst = (Int64)((double)dripRate * m_quantumsPerBurst);
|
|
||||||
m_lastDrip = Util.EnvironmentTickCount() + 100000;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Constructor
|
#endregion Constructor
|
||||||
|
@ -210,7 +208,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
protected float DripRateModifier()
|
protected float DripRateModifier()
|
||||||
{
|
{
|
||||||
float driprate = DripRate;
|
float driprate = DripRate;
|
||||||
return driprate >= TotalDripRequest ? 1.0f : driprate / TotalDripRequest;
|
return driprate >= TotalDripRequest ? 1.0f : (driprate / TotalDripRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -313,14 +311,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Int32 now = Util.EnvironmentTickCount();
|
double now = Util.GetTimeStampMS();
|
||||||
Int32 deltaMS = now - m_lastDrip;
|
double deltaMS = now - m_lastDrip;
|
||||||
m_lastDrip = now;
|
m_lastDrip = now;
|
||||||
|
|
||||||
if (deltaMS <= 0)
|
if (deltaMS <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_tokenCount += deltaMS * DripRate * m_timeScale;
|
m_tokenCount += (float)deltaMS * DripRate * m_timeScale;
|
||||||
|
|
||||||
float burst = Burst;
|
float burst = Burst;
|
||||||
if (m_tokenCount > burst)
|
if (m_tokenCount > burst)
|
||||||
|
|
Loading…
Reference in New Issue