diff options
author | Justin Clarke Casey | 2008-10-06 16:48:41 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-06 16:48:41 +0000 |
commit | 33d957207cc598e1a61edad42b4b734a26c362f9 (patch) | |
tree | 22b3a0c253746e9f45776eed0e785ebb5a5aef9b /OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs | |
parent | Mantis#2342. Thank you kindly, Ralphos for a patch that solves: (diff) | |
download | opensim-SC-33d957207cc598e1a61edad42b4b734a26c362f9.zip opensim-SC-33d957207cc598e1a61edad42b4b734a26c362f9.tar.gz opensim-SC-33d957207cc598e1a61edad42b4b734a26c362f9.tar.bz2 opensim-SC-33d957207cc598e1a61edad42b4b734a26c362f9.tar.xz |
* 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
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs index b9f4594..bfb3f6e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs | |||
@@ -26,37 +26,43 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | namespace OpenSim.Region.ClientStack.LindenUDP | 28 | namespace OpenSim.Region.ClientStack.LindenUDP |
29 | { | 29 | { |
30 | public class LLPacketThrottle | 30 | public class LLPacketThrottle |
31 | { | 31 | { |
32 | private readonly int m_maxAllowableThrottle; | 32 | private readonly int m_maxAllowableThrottle; |
33 | private readonly int m_minAllowableThrottle; | 33 | private readonly int m_minAllowableThrottle; |
34 | private int m_currentThrottle; | 34 | private int m_currentThrottle; |
35 | private const int m_throttleTimeDivisor = 7; | 35 | private const int m_throttleTimeDivisor = 7; |
36 | private int m_currentBytesSent; | 36 | private int m_currentBitsSent; |
37 | 37 | ||
38 | public LLPacketThrottle(int Min, int Max, int Throttle) | 38 | public LLPacketThrottle(int Min, int Max, int Throttle) |
39 | { | 39 | { |
40 | m_maxAllowableThrottle = Max; | 40 | m_maxAllowableThrottle = Max; |
41 | m_minAllowableThrottle = Min; | 41 | m_minAllowableThrottle = Min; |
42 | m_currentThrottle = Throttle; | 42 | m_currentThrottle = Throttle; |
43 | m_currentBytesSent = 0; | 43 | m_currentBitsSent = 0; |
44 | } | 44 | } |
45 | 45 | ||
46 | public void Reset() | 46 | public void Reset() |
47 | { | 47 | { |
48 | m_currentBytesSent = 0; | 48 | m_currentBitsSent = 0; |
49 | } | 49 | } |
50 | 50 | ||
51 | public bool UnderLimit() | 51 | public bool UnderLimit() |
52 | { | 52 | { |
53 | return (m_currentBytesSent < (m_currentThrottle/m_throttleTimeDivisor)); | 53 | return (m_currentBitsSent < (m_currentThrottle/m_throttleTimeDivisor)); |
54 | } | ||
55 | |||
56 | public int AddBits(int bits) | ||
57 | { | ||
58 | m_currentBitsSent += bits; | ||
59 | return m_currentBitsSent; | ||
54 | } | 60 | } |
55 | 61 | ||
56 | public int Add(int bytes) | 62 | public int AddBytes(int bytes) |
57 | { | 63 | { |
58 | m_currentBytesSent += bytes; | 64 | m_currentBitsSent += bytes * 8; |
59 | return m_currentBytesSent; | 65 | return m_currentBitsSent; |
60 | } | 66 | } |
61 | 67 | ||
62 | // Properties | 68 | // Properties |