mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
* Change interpretation of asset throttle values to bits per second rather than bytes per second
* Changing network bandwidth in the preferences will now have a much more noticeable effect - a user may want to increase this if data is being slow to download from opensim
This commit is contained in:
@@ -26,37 +26,43 @@
|
||||
*/
|
||||
|
||||
namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
{
|
||||
public class LLPacketThrottle
|
||||
{
|
||||
private readonly int m_maxAllowableThrottle;
|
||||
private readonly int m_minAllowableThrottle;
|
||||
private int m_currentThrottle;
|
||||
private const int m_throttleTimeDivisor = 7;
|
||||
private int m_currentBytesSent;
|
||||
private int m_currentBitsSent;
|
||||
|
||||
public LLPacketThrottle(int Min, int Max, int Throttle)
|
||||
{
|
||||
m_maxAllowableThrottle = Max;
|
||||
m_minAllowableThrottle = Min;
|
||||
m_currentThrottle = Throttle;
|
||||
m_currentBytesSent = 0;
|
||||
m_currentBitsSent = 0;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
m_currentBytesSent = 0;
|
||||
m_currentBitsSent = 0;
|
||||
}
|
||||
|
||||
public bool UnderLimit()
|
||||
{
|
||||
return (m_currentBytesSent < (m_currentThrottle/m_throttleTimeDivisor));
|
||||
return (m_currentBitsSent < (m_currentThrottle/m_throttleTimeDivisor));
|
||||
}
|
||||
|
||||
public int AddBits(int bits)
|
||||
{
|
||||
m_currentBitsSent += bits;
|
||||
return m_currentBitsSent;
|
||||
}
|
||||
|
||||
public int Add(int bytes)
|
||||
public int AddBytes(int bytes)
|
||||
{
|
||||
m_currentBytesSent += bytes;
|
||||
return m_currentBytesSent;
|
||||
m_currentBitsSent += bytes * 8;
|
||||
return m_currentBitsSent;
|
||||
}
|
||||
|
||||
// Properties
|
||||
|
||||
Reference in New Issue
Block a user