add some functions for estimation of number of bytes that can be send in a category in specified time
parent
ff4df688ba
commit
5a2d4fd47f
|
@ -454,6 +454,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int GetCatBytesCanSend(ThrottleOutPacketType cat, int timeMS)
|
||||||
|
{
|
||||||
|
TokenBucket bucket = m_throttleCategories[(int)cat];
|
||||||
|
int bytes = timeMS * (int)(bucket.RequestedDripRate / 1000);
|
||||||
|
bytes += (int)bucket.CurrentTokenCount();
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Queue an outgoing packet if appropriate.
|
/// Queue an outgoing packet if appropriate.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -274,6 +274,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long CurrentTokenCount()
|
||||||
|
{
|
||||||
|
return m_tokenCount;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deposit tokens into the bucket from a child bucket that did
|
/// Deposit tokens into the bucket from a child bucket that did
|
||||||
/// not use all of its available tokens
|
/// not use all of its available tokens
|
||||||
|
|
Loading…
Reference in New Issue