diff options
author | UbitUmarov | 2014-08-28 16:49:32 +0100 |
---|---|---|
committer | UbitUmarov | 2014-08-28 16:49:32 +0100 |
commit | 5a2d4fd47f64a656b36fd428473715d9f764729b (patch) | |
tree | 28f0723946425081ff683524a3bb0d8e15eb1198 /OpenSim/Region/ClientStack | |
parent | send all presences terseupdates in same batch (diff) | |
download | opensim-SC-5a2d4fd47f64a656b36fd428473715d9f764729b.zip opensim-SC-5a2d4fd47f64a656b36fd428473715d9f764729b.tar.gz opensim-SC-5a2d4fd47f64a656b36fd428473715d9f764729b.tar.bz2 opensim-SC-5a2d4fd47f64a656b36fd428473715d9f764729b.tar.xz |
add some functions for estimation of number of bytes that can be send in a category in specified time
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index bb68921..7c55b37 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | |||
@@ -453,6 +453,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
453 | 453 | ||
454 | return data; | 454 | return data; |
455 | } | 455 | } |
456 | |||
457 | public int GetCatBytesCanSend(ThrottleOutPacketType cat, int timeMS) | ||
458 | { | ||
459 | TokenBucket bucket = m_throttleCategories[(int)cat]; | ||
460 | int bytes = timeMS * (int)(bucket.RequestedDripRate / 1000); | ||
461 | bytes += (int)bucket.CurrentTokenCount(); | ||
462 | return bytes; | ||
463 | } | ||
456 | 464 | ||
457 | /// <summary> | 465 | /// <summary> |
458 | /// Queue an outgoing packet if appropriate. | 466 | /// Queue an outgoing packet if appropriate. |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs index 4c33db5..2a60b48 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs | |||
@@ -274,6 +274,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
274 | return false; | 274 | return false; |
275 | } | 275 | } |
276 | 276 | ||
277 | public long CurrentTokenCount() | ||
278 | { | ||
279 | return m_tokenCount; | ||
280 | } | ||
281 | |||
277 | /// <summary> | 282 | /// <summary> |
278 | /// Deposit tokens into the bucket from a child bucket that did | 283 | /// Deposit tokens into the bucket from a child bucket that did |
279 | /// not use all of its available tokens | 284 | /// not use all of its available tokens |