aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
diff options
context:
space:
mode:
authorUbitUmarov2019-11-16 22:19:46 +0000
committerUbitUmarov2019-11-16 22:19:46 +0000
commit61f918cbda3d928356a15e2b98767279d5b4262b (patch)
tree29308496ab2defccd51d7cb16bafe39d4a9c00cf /OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
parentmake attachments WearReplacesAll option visible (diff)
downloadopensim-SC-61f918cbda3d928356a15e2b98767279d5b4262b.zip
opensim-SC-61f918cbda3d928356a15e2b98767279d5b4262b.tar.gz
opensim-SC-61f918cbda3d928356a15e2b98767279d5b4262b.tar.bz2
opensim-SC-61f918cbda3d928356a15e2b98767279d5b4262b.tar.xz
remove some llUDP options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs79
1 files changed, 19 insertions, 60 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
index 4e9cf1c..69e53f6 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
@@ -65,11 +65,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
65 /// </summary> 65 /// </summary>
66 public sealed class LLUDPClient 66 public sealed class LLUDPClient
67 { 67 {
68 // TODO: Make this a config setting
69 /// <summary>Percentage of the task throttle category that is allocated to avatar and prim
70 /// state updates</summary>
71 const float STATE_TASK_PERCENTAGE = 0.8f;
72
73 private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 68 private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
74 69
75 /// <summary>The number of packet categories to throttle on. If a throttle category is added 70 /// <summary>The number of packet categories to throttle on. If a throttle category is added
@@ -194,6 +189,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
194 public bool m_deliverPackets = true; 189 public bool m_deliverPackets = true;
195 190
196 private float m_burstTime; 191 private float m_burstTime;
192 private int m_maxRate;
197 193
198 public double m_lastStartpingTimeMS; 194 public double m_lastStartpingTimeMS;
199 public int m_pingMS; 195 public int m_pingMS;
@@ -243,16 +239,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
243 m_maxRTO = maxRTO; 239 m_maxRTO = maxRTO;
244 240
245 m_burstTime = rates.BurstTime; 241 m_burstTime = rates.BurstTime;
246 float m_burst = rates.ClientMaxRate * m_burstTime; 242 m_maxRate = rates.ClientMaxRate;
247 243
248 // Create a token bucket throttle for this client that has the scene token bucket as a parent 244 // Create a token bucket throttle for this client that has the scene token bucket as a parent
249 m_throttleClient = new AdaptiveTokenBucket(parentThrottle, rates.ClientMaxRate, m_burst, rates.AdaptiveThrottlesEnabled); 245 m_throttleClient = new AdaptiveTokenBucket(parentThrottle, m_maxRate, m_maxRate * m_burstTime, rates.AdaptiveThrottlesEnabled);
250 246
251 // Create an array of token buckets for this clients different throttle categories 247 // Create an array of token buckets for this clients different throttle categories
252 m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT]; 248 m_throttleCategories = new TokenBucket[THROTTLE_CATEGORY_COUNT];
253 249
254 m_burst = rates.Total * rates.BurstTime;
255
256 for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++) 250 for (int i = 0; i < THROTTLE_CATEGORY_COUNT; i++)
257 { 251 {
258 ThrottleOutPacketType type = (ThrottleOutPacketType)i; 252 ThrottleOutPacketType type = (ThrottleOutPacketType)i;
@@ -260,18 +254,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
260 // Initialize the packet outboxes, where packets sit while they are waiting for tokens 254 // Initialize the packet outboxes, where packets sit while they are waiting for tokens
261 m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>(); 255 m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>();
262 // Initialize the token buckets that control the throttling for each category 256 // Initialize the token buckets that control the throttling for each category
263 //m_throttleCategories[i] = new TokenBucket(m_throttleClient, rates.GetRate(type), m_burst);
264 float rate = rates.GetRate(type); 257 float rate = rates.GetRate(type);
265 float burst = rate * rates.BurstTime; 258 float burst = rate * m_burstTime;
266 m_throttleCategories[i] = new TokenBucket(m_throttleClient, rate , burst); 259 m_throttleCategories[i] = new TokenBucket(m_throttleClient, rate , burst);
267 } 260 }
268 261
269 // Default the retransmission timeout to one second
270 m_RTO = m_defaultRTO; 262 m_RTO = m_defaultRTO;
271 263
272 // Initialize this to a sane value to prevent early disconnects 264 // Initialize this to a sane value to prevent early disconnects
273 TickLastPacketReceived = Environment.TickCount & Int32.MaxValue; 265 TickLastPacketReceived = Environment.TickCount & Int32.MaxValue;
274 m_pingMS = (int)(3.0 * server.TickCountResolution); // so filter doesnt start at 0; 266 m_pingMS = 20; // so filter doesnt start at 0;
275 } 267 }
276 268
277 /// <summary> 269 /// <summary>
@@ -429,24 +421,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
429 int texture = (int)(BitConverter.ToSingle(adjData, pos) * scale); pos += 4; 421 int texture = (int)(BitConverter.ToSingle(adjData, pos) * scale); pos += 4;
430 int asset = (int)(BitConverter.ToSingle(adjData, pos) * scale); 422 int asset = (int)(BitConverter.ToSingle(adjData, pos) * scale);
431 423
432
433
434 // Make sure none of the throttles are set below our packet MTU,
435 // otherwise a throttle could become permanently clogged
436
437/* now using floats
438 resend = Math.Max(resend, LLUDPServer.MTU);
439 land = Math.Max(land, LLUDPServer.MTU);
440 wind = Math.Max(wind, LLUDPServer.MTU);
441 cloud = Math.Max(cloud, LLUDPServer.MTU);
442 task = Math.Max(task, LLUDPServer.MTU);
443 texture = Math.Max(texture, LLUDPServer.MTU);
444 asset = Math.Max(asset, LLUDPServer.MTU);
445*/
446
447 int total = resend + land + wind + cloud + task + texture + asset; 424 int total = resend + land + wind + cloud + task + texture + asset;
448 425 if(total > m_maxRate)
449 //float m_burst = total * m_burstTime; 426 {
427 scale = (float)total / m_maxRate;
428 resend = (int)(resend * scale);
429 land = (int)(land * scale);
430 wind = (int)(wind * scale);
431 cloud = (int)(cloud * scale);
432 task = (int)(task * scale);
433 texture = (int)(texture * scale);
434 asset = (int)(texture * scale);
435 int ntotal = resend + land + wind + cloud + task + texture + asset;
436 m_log.DebugFormat("[LLUDPCLIENT]: limiting {0} bandwith from {1} to {2}",AgentID, ntotal, total);
437 total = ntotal;
438 }
450 439
451 if (ThrottleDebugLevel > 0) 440 if (ThrottleDebugLevel > 0)
452 { 441 {
@@ -456,35 +445,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
456 } 445 }
457 446
458 TokenBucket bucket; 447 TokenBucket bucket;
459 /*
460 bucket = m_throttleCategories[(int)ThrottleOutPacketType.Resend];
461 bucket.RequestedDripRate = resend;
462 bucket.RequestedBurst = m_burst;
463
464 bucket = m_throttleCategories[(int)ThrottleOutPacketType.Land];
465 bucket.RequestedDripRate = land;
466 bucket.RequestedBurst = m_burst;
467
468 bucket = m_throttleCategories[(int)ThrottleOutPacketType.Wind];
469 bucket.RequestedDripRate = wind;
470 bucket.RequestedBurst = m_burst;
471
472 bucket = m_throttleCategories[(int)ThrottleOutPacketType.Cloud];
473 bucket.RequestedDripRate = cloud;
474 bucket.RequestedBurst = m_burst;
475
476 bucket = m_throttleCategories[(int)ThrottleOutPacketType.Asset];
477 bucket.RequestedDripRate = asset;
478 bucket.RequestedBurst = m_burst;
479
480 bucket = m_throttleCategories[(int)ThrottleOutPacketType.Task];
481 bucket.RequestedDripRate = task;
482 bucket.RequestedBurst = m_burst;
483
484 bucket = m_throttleCategories[(int)ThrottleOutPacketType.Texture];
485 bucket.RequestedDripRate = texture;
486 bucket.RequestedBurst = m_burst;
487 */
488 bucket = m_throttleCategories[(int)ThrottleOutPacketType.Resend]; 448 bucket = m_throttleCategories[(int)ThrottleOutPacketType.Resend];
489 bucket.RequestedDripRate = resend; 449 bucket.RequestedDripRate = resend;
490 bucket.RequestedBurst = resend * m_burstTime; 450 bucket.RequestedBurst = resend * m_burstTime;
@@ -513,7 +473,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
513 bucket.RequestedDripRate = texture; 473 bucket.RequestedDripRate = texture;
514 bucket.RequestedBurst = texture * m_burstTime; 474 bucket.RequestedBurst = texture * m_burstTime;
515 475
516 // Reset the packed throttles cached data
517 m_packedThrottles = null; 476 m_packedThrottles = null;
518 } 477 }
519 478