aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-21 00:18:35 -0700
committerJohn Hurliman2009-10-21 00:18:35 -0700
commitcde47c2b3d7089be556252246eb03365c1f39b54 (patch)
treeb0b1cddc57f786a2d5945c1117cddda75e52b1ed /OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
parent* Added a sanity check to GetScriptAssemblies() and GetScriptStates() for the... (diff)
downloadopensim-SC_OLD-cde47c2b3d7089be556252246eb03365c1f39b54.zip
opensim-SC_OLD-cde47c2b3d7089be556252246eb03365c1f39b54.tar.gz
opensim-SC_OLD-cde47c2b3d7089be556252246eb03365c1f39b54.tar.bz2
opensim-SC_OLD-cde47c2b3d7089be556252246eb03365c1f39b54.tar.xz
Committing Jim's optimization to replace the 20ms sleep in outgoing packet handling with an interruptible wait handle
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs16
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
index 0a64095..bdbd284 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs
@@ -98,6 +98,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
98 } 98 }
99 99
100 /// <summary> 100 /// <summary>
101 /// The speed limit of this bucket in bytes per millisecond
102 /// </summary>
103 public int DripPerMS
104 {
105 get { return tokensPerMS; }
106 }
107
108 /// <summary>
101 /// The number of bytes that can be sent at this moment. This is the 109 /// The number of bytes that can be sent at this moment. This is the
102 /// current number of tokens in the bucket 110 /// current number of tokens in the bucket
103 /// <remarks>If this bucket has a parent bucket that does not have 111 /// <remarks>If this bucket has a parent bucket that does not have
@@ -106,11 +114,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
106 /// </summary> 114 /// </summary>
107 public int Content 115 public int Content
108 { 116 {
109 get 117 get { return content; }
110 {
111 Drip();
112 return content;
113 }
114 } 118 }
115 119
116 #endregion Properties 120 #endregion Properties
@@ -182,7 +186,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
182 /// call to Drip 186 /// call to Drip
183 /// </summary> 187 /// </summary>
184 /// <returns>True if tokens were added to the bucket, otherwise false</returns> 188 /// <returns>True if tokens were added to the bucket, otherwise false</returns>
185 private bool Drip() 189 public bool Drip()
186 { 190 {
187 if (tokensPerMS == 0) 191 if (tokensPerMS == 0)
188 { 192 {