mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
remove some llUDP options
This commit is contained in:
@@ -65,11 +65,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// </summary>
|
||||
public sealed class LLUDPClient
|
||||
{
|
||||
// TODO: Make this a config setting
|
||||
/// <summary>Percentage of the task throttle category that is allocated to avatar and prim
|
||||
/// state updates</summary>
|
||||
const float STATE_TASK_PERCENTAGE = 0.8f;
|
||||
|
||||
private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>The number of packet categories to throttle on. If a throttle category is added
|
||||
@@ -194,6 +189,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public bool m_deliverPackets = true;
|
||||
|
||||
private float m_burstTime;
|
||||
private int m_maxRate;
|
||||
|
||||
public double m_lastStartpingTimeMS;
|
||||
public int m_pingMS;
|
||||
@@ -243,16 +239,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
m_maxRTO = maxRTO;
|
||||
|
||||
m_burstTime = rates.BurstTime;
|
||||
float m_burst = rates.ClientMaxRate * m_burstTime;
|
||||
m_maxRate = rates.ClientMaxRate;
|
||||
|
||||
// Create a token bucket throttle for this client that has the scene token bucket as a parent
|
||||
m_throttleClient = new AdaptiveTokenBucket(parentThrottle, rates.ClientMaxRate, m_burst, rates.AdaptiveThrottlesEnabled);
|
||||
m_throttleClient = new AdaptiveTokenBucket(parentThrottle, m_maxRate, m_maxRate * m_burstTime, rates.AdaptiveThrottlesEnabled);
|
||||
|
||||
// Create an array of token buckets for this clients different throttle categories
|
||||
m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT];
|
||||
|
||||
m_burst = rates.Total * rates.BurstTime;
|
||||
|
||||
for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++)
|
||||
{
|
||||
ThrottleOutPacketType type = (ThrottleOutPacketType)i;
|
||||
@@ -260,18 +254,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// Initialize the packet outboxes, where packets sit while they are waiting for tokens
|
||||
m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>();
|
||||
// Initialize the token buckets that control the throttling for each category
|
||||
//m_throttleCategories[i] = new TokenBucket(m_throttleClient, rates.GetRate(type), m_burst);
|
||||
float rate = rates.GetRate(type);
|
||||
float burst = rate * rates.BurstTime;
|
||||
float burst = rate * m_burstTime;
|
||||
m_throttleCategories[i] = new TokenBucket(m_throttleClient, rate , burst);
|
||||
}
|
||||
|
||||
// Default the retransmission timeout to one second
|
||||
m_RTO = m_defaultRTO;
|
||||
|
||||
// Initialize this to a sane value to prevent early disconnects
|
||||
TickLastPacketReceived = Environment.TickCount & Int32.MaxValue;
|
||||
m_pingMS = (int)(3.0 * server.TickCountResolution); // so filter doesnt start at 0;
|
||||
m_pingMS = 20; // so filter doesnt start at 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -429,24 +421,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
int texture = (int)(BitConverter.ToSingle(adjData, pos) * scale); pos += 4;
|
||||
int asset = (int)(BitConverter.ToSingle(adjData, pos) * scale);
|
||||
|
||||
|
||||
|
||||
// Make sure none of the throttles are set below our packet MTU,
|
||||
// otherwise a throttle could become permanently clogged
|
||||
|
||||
/* now using floats
|
||||
resend = Math.Max(resend, LLUDPServer.MTU);
|
||||
land = Math.Max(land, LLUDPServer.MTU);
|
||||
wind = Math.Max(wind, LLUDPServer.MTU);
|
||||
cloud = Math.Max(cloud, LLUDPServer.MTU);
|
||||
task = Math.Max(task, LLUDPServer.MTU);
|
||||
texture = Math.Max(texture, LLUDPServer.MTU);
|
||||
asset = Math.Max(asset, LLUDPServer.MTU);
|
||||
*/
|
||||
|
||||
int total = resend + land + wind + cloud + task + texture + asset;
|
||||
|
||||
//float m_burst = total * m_burstTime;
|
||||
if(total > m_maxRate)
|
||||
{
|
||||
scale = (float)total / m_maxRate;
|
||||
resend = (int)(resend * scale);
|
||||
land = (int)(land * scale);
|
||||
wind = (int)(wind * scale);
|
||||
cloud = (int)(cloud * scale);
|
||||
task = (int)(task * scale);
|
||||
texture = (int)(texture * scale);
|
||||
asset = (int)(texture * scale);
|
||||
int ntotal = resend + land + wind + cloud + task + texture + asset;
|
||||
m_log.DebugFormat("[LLUDPCLIENT]: limiting {0} bandwith from {1} to {2}",AgentID, ntotal, total);
|
||||
total = ntotal;
|
||||
}
|
||||
|
||||
if (ThrottleDebugLevel > 0)
|
||||
{
|
||||
@@ -456,35 +445,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
|
||||
TokenBucket bucket;
|
||||
/*
|
||||
bucket = m_throttleCategories[(int)ThrottleOutPacketType.Resend];
|
||||
bucket.RequestedDripRate = resend;
|
||||
bucket.RequestedBurst = m_burst;
|
||||
|
||||
bucket = m_throttleCategories[(int)ThrottleOutPacketType.Land];
|
||||
bucket.RequestedDripRate = land;
|
||||
bucket.RequestedBurst = m_burst;
|
||||
|
||||
bucket = m_throttleCategories[(int)ThrottleOutPacketType.Wind];
|
||||
bucket.RequestedDripRate = wind;
|
||||
bucket.RequestedBurst = m_burst;
|
||||
|
||||
bucket = m_throttleCategories[(int)ThrottleOutPacketType.Cloud];
|
||||
bucket.RequestedDripRate = cloud;
|
||||
bucket.RequestedBurst = m_burst;
|
||||
|
||||
bucket = m_throttleCategories[(int)ThrottleOutPacketType.Asset];
|
||||
bucket.RequestedDripRate = asset;
|
||||
bucket.RequestedBurst = m_burst;
|
||||
|
||||
bucket = m_throttleCategories[(int)ThrottleOutPacketType.Task];
|
||||
bucket.RequestedDripRate = task;
|
||||
bucket.RequestedBurst = m_burst;
|
||||
|
||||
bucket = m_throttleCategories[(int)ThrottleOutPacketType.Texture];
|
||||
bucket.RequestedDripRate = texture;
|
||||
bucket.RequestedBurst = m_burst;
|
||||
*/
|
||||
bucket = m_throttleCategories[(int)ThrottleOutPacketType.Resend];
|
||||
bucket.RequestedDripRate = resend;
|
||||
bucket.RequestedBurst = resend * m_burstTime;
|
||||
@@ -513,7 +473,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
bucket.RequestedDripRate = texture;
|
||||
bucket.RequestedBurst = texture * m_burstTime;
|
||||
|
||||
// Reset the packed throttles cached data
|
||||
m_packedThrottles = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user