mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
add some functions for estimation of number of bytes that can be send in a category in specified time
This commit is contained in:
@@ -453,6 +453,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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user