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;
|
||||
}
|
||||
|
||||
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>
|
||||
/// Queue an outgoing packet if appropriate.
|
||||
/// </summary>
|
||||
|
|
|
@ -274,6 +274,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
return false;
|
||||
}
|
||||
|
||||
public long CurrentTokenCount()
|
||||
{
|
||||
return m_tokenCount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deposit tokens into the bucket from a child bucket that did
|
||||
/// not use all of its available tokens
|
||||
|
|
Loading…
Reference in New Issue