diff options
Diffstat (limited to '')
3 files changed, 55 insertions, 55 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs index a935dd2..0e1a9e3 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
70 | m_scene = new SceneHelpers().SetupScene(); | 70 | m_scene = new SceneHelpers().SetupScene(); |
71 | StatsManager.SimExtraStats = new SimExtraStatsCollector(); | 71 | StatsManager.SimExtraStats = new SimExtraStatsCollector(); |
72 | } | 72 | } |
73 | 73 | ||
74 | // /// <summary> | 74 | // /// <summary> |
75 | // /// Build an object name packet for test purposes | 75 | // /// Build an object name packet for test purposes |
76 | // /// </summary> | 76 | // /// </summary> |
@@ -84,7 +84,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
84 | // odb.Name = Utils.StringToBytes(objectName); | 84 | // odb.Name = Utils.StringToBytes(objectName); |
85 | // onp.ObjectData = new ObjectNamePacket.ObjectDataBlock[] { odb }; | 85 | // onp.ObjectData = new ObjectNamePacket.ObjectDataBlock[] { odb }; |
86 | // onp.Header.Zerocoded = false; | 86 | // onp.Header.Zerocoded = false; |
87 | // | 87 | // |
88 | // return onp; | 88 | // return onp; |
89 | // } | 89 | // } |
90 | // | 90 | // |
@@ -156,7 +156,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
156 | config.Set("AckTimeout", -1); | 156 | config.Set("AckTimeout", -1); |
157 | TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(m_scene, ics); | 157 | TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(m_scene, ics); |
158 | 158 | ||
159 | ScenePresence sp | 159 | ScenePresence sp |
160 | = ClientStackHelpers.AddChildClient( | 160 | = ClientStackHelpers.AddChildClient( |
161 | m_scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); | 161 | m_scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); |
162 | 162 | ||
@@ -175,21 +175,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
175 | // TestHelper.InMethod(); | 175 | // TestHelper.InMethod(); |
176 | // | 176 | // |
177 | // uint myCircuitCode = 123457; | 177 | // uint myCircuitCode = 123457; |
178 | // | 178 | // |
179 | // TestLLUDPServer testLLUDPServer; | 179 | // TestLLUDPServer testLLUDPServer; |
180 | // TestLLPacketServer testLLPacketServer; | 180 | // TestLLPacketServer testLLPacketServer; |
181 | // AgentCircuitManager acm; | 181 | // AgentCircuitManager acm; |
182 | // SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm); | 182 | // SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm); |
183 | // AddClient(myCircuitCode, new IPEndPoint(IPAddress.Loopback, 1000), testLLUDPServer, acm); | 183 | // AddClient(myCircuitCode, new IPEndPoint(IPAddress.Loopback, 1000), testLLUDPServer, acm); |
184 | // | 184 | // |
185 | // testLLUDPServer.RemoveClientCircuit(myCircuitCode); | 185 | // testLLUDPServer.RemoveClientCircuit(myCircuitCode); |
186 | // Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode)); | 186 | // Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode)); |
187 | // | 187 | // |
188 | // // Check that removing a non-existent circuit doesn't have any bad effects | 188 | // // Check that removing a non-existent circuit doesn't have any bad effects |
189 | // testLLUDPServer.RemoveClientCircuit(101); | 189 | // testLLUDPServer.RemoveClientCircuit(101); |
190 | // Assert.IsFalse(testLLUDPServer.HasCircuit(101)); | 190 | // Assert.IsFalse(testLLUDPServer.HasCircuit(101)); |
191 | // } | 191 | // } |
192 | // | 192 | // |
193 | // /// <summary> | 193 | // /// <summary> |
194 | // /// Make sure that the client stack reacts okay to malformed packets | 194 | // /// Make sure that the client stack reacts okay to malformed packets |
195 | // /// </summary> | 195 | // /// </summary> |
@@ -200,8 +200,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
200 | // | 200 | // |
201 | // uint myCircuitCode = 123458; | 201 | // uint myCircuitCode = 123458; |
202 | // EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 1001); | 202 | // EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 1001); |
203 | // MockScene scene = new MockScene(); | 203 | // MockScene scene = new MockScene(); |
204 | // | 204 | // |
205 | // TestLLUDPServer testLLUDPServer; | 205 | // TestLLUDPServer testLLUDPServer; |
206 | // TestLLPacketServer testLLPacketServer; | 206 | // TestLLPacketServer testLLPacketServer; |
207 | // AgentCircuitManager acm; | 207 | // AgentCircuitManager acm; |
@@ -213,24 +213,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
213 | // // Send two garbled 'packets' in succession | 213 | // // Send two garbled 'packets' in succession |
214 | // testLLUDPServer.LoadReceive(data, testEp); | 214 | // testLLUDPServer.LoadReceive(data, testEp); |
215 | // testLLUDPServer.LoadReceive(data, testEp); | 215 | // testLLUDPServer.LoadReceive(data, testEp); |
216 | // testLLUDPServer.ReceiveData(null); | 216 | // testLLUDPServer.ReceiveData(null); |
217 | // | 217 | // |
218 | // // Check that we are still here | 218 | // // Check that we are still here |
219 | // Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode)); | 219 | // Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode)); |
220 | // Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(0)); | 220 | // Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(0)); |
221 | // | 221 | // |
222 | // // Check that sending a valid packet to same circuit still succeeds | 222 | // // Check that sending a valid packet to same circuit still succeeds |
223 | // Assert.That(scene.ObjectNameCallsReceived, Is.EqualTo(0)); | 223 | // Assert.That(scene.ObjectNameCallsReceived, Is.EqualTo(0)); |
224 | // | 224 | // |
225 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "helloooo"), testEp); | 225 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "helloooo"), testEp); |
226 | // testLLUDPServer.ReceiveData(null); | 226 | // testLLUDPServer.ReceiveData(null); |
227 | // | 227 | // |
228 | // Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(1)); | 228 | // Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(1)); |
229 | // Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(1)); | 229 | // Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(1)); |
230 | // } | 230 | // } |
231 | // | 231 | // |
232 | // /// <summary> | 232 | // /// <summary> |
233 | // /// Test that the stack continues to work even if some client has caused a | 233 | // /// Test that the stack continues to work even if some client has caused a |
234 | // /// SocketException on Socket.BeginReceive() | 234 | // /// SocketException on Socket.BeginReceive() |
235 | // /// </summary> | 235 | // /// </summary> |
236 | // [Test] | 236 | // [Test] |
@@ -239,32 +239,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
239 | // TestHelper.InMethod(); | 239 | // TestHelper.InMethod(); |
240 | // | 240 | // |
241 | // MockScene scene = new MockScene(); | 241 | // MockScene scene = new MockScene(); |
242 | // | 242 | // |
243 | // uint circuitCodeA = 130000; | 243 | // uint circuitCodeA = 130000; |
244 | // EndPoint epA = new IPEndPoint(IPAddress.Loopback, 1300); | 244 | // EndPoint epA = new IPEndPoint(IPAddress.Loopback, 1300); |
245 | // UUID agentIdA = UUID.Parse("00000000-0000-0000-0000-000000001300"); | 245 | // UUID agentIdA = UUID.Parse("00000000-0000-0000-0000-000000001300"); |
246 | // UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300"); | 246 | // UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300"); |
247 | // | 247 | // |
248 | // uint circuitCodeB = 130001; | 248 | // uint circuitCodeB = 130001; |
249 | // EndPoint epB = new IPEndPoint(IPAddress.Loopback, 1301); | 249 | // EndPoint epB = new IPEndPoint(IPAddress.Loopback, 1301); |
250 | // UUID agentIdB = UUID.Parse("00000000-0000-0000-0000-000000001301"); | 250 | // UUID agentIdB = UUID.Parse("00000000-0000-0000-0000-000000001301"); |
251 | // UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301"); | 251 | // UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301"); |
252 | // | 252 | // |
253 | // TestLLUDPServer testLLUDPServer; | 253 | // TestLLUDPServer testLLUDPServer; |
254 | // TestLLPacketServer testLLPacketServer; | 254 | // TestLLPacketServer testLLPacketServer; |
255 | // AgentCircuitManager acm; | 255 | // AgentCircuitManager acm; |
256 | // SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); | 256 | // SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); |
257 | // AddClient(circuitCodeA, epA, agentIdA, sessionIdA, testLLUDPServer, acm); | 257 | // AddClient(circuitCodeA, epA, agentIdA, sessionIdA, testLLUDPServer, acm); |
258 | // AddClient(circuitCodeB, epB, agentIdB, sessionIdB, testLLUDPServer, acm); | 258 | // AddClient(circuitCodeB, epB, agentIdB, sessionIdB, testLLUDPServer, acm); |
259 | // | 259 | // |
260 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "packet1"), epA); | 260 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "packet1"), epA); |
261 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "packet2"), epB); | 261 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "packet2"), epB); |
262 | // testLLUDPServer.LoadReceiveWithBeginException(epA); | 262 | // testLLUDPServer.LoadReceiveWithBeginException(epA); |
263 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(2, "packet3"), epB); | 263 | // testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(2, "packet3"), epB); |
264 | // testLLUDPServer.ReceiveData(null); | 264 | // testLLUDPServer.ReceiveData(null); |
265 | // | 265 | // |
266 | // Assert.IsFalse(testLLUDPServer.HasCircuit(circuitCodeA)); | 266 | // Assert.IsFalse(testLLUDPServer.HasCircuit(circuitCodeA)); |
267 | // | 267 | // |
268 | // Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3)); | 268 | // Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3)); |
269 | // Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3)); | 269 | // Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3)); |
270 | // } | 270 | // } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/PacketHandlerTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/PacketHandlerTests.cs index 92f1fc3..1731aa9 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/PacketHandlerTests.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/PacketHandlerTests.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
59 | // agent.InventoryFolder = UUID.Zero; | 59 | // agent.InventoryFolder = UUID.Zero; |
60 | // agent.startpos = Vector3.Zero; | 60 | // agent.startpos = Vector3.Zero; |
61 | // agent.CapsPath = "http://wibble.com"; | 61 | // agent.CapsPath = "http://wibble.com"; |
62 | // | 62 | // |
63 | // TestLLUDPServer testLLUDPServer; | 63 | // TestLLUDPServer testLLUDPServer; |
64 | // TestLLPacketServer testLLPacketServer; | 64 | // TestLLPacketServer testLLPacketServer; |
65 | // AgentCircuitManager acm; | 65 | // AgentCircuitManager acm; |
@@ -67,7 +67,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
67 | // SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); | 67 | // SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); |
68 | // | 68 | // |
69 | // TestClient testClient = new TestClient(agent, scene); | 69 | // TestClient testClient = new TestClient(agent, scene); |
70 | // | 70 | // |
71 | // LLPacketHandler packetHandler | 71 | // LLPacketHandler packetHandler |
72 | // = new LLPacketHandler(testClient, testLLPacketServer, new ClientStackUserSettings()); | 72 | // = new LLPacketHandler(testClient, testLLPacketServer, new ClientStackUserSettings()); |
73 | // | 73 | // |
@@ -87,14 +87,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
87 | // /// <param name="testPacketServer"></param> | 87 | // /// <param name="testPacketServer"></param> |
88 | // /// <param name="acm">Agent circuit manager used in setting up the stack</param> | 88 | // /// <param name="acm">Agent circuit manager used in setting up the stack</param> |
89 | // protected void SetupStack( | 89 | // protected void SetupStack( |
90 | // IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, | 90 | // IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, |
91 | // out AgentCircuitManager acm) | 91 | // out AgentCircuitManager acm) |
92 | // { | 92 | // { |
93 | // IConfigSource configSource = new IniConfigSource(); | 93 | // IConfigSource configSource = new IniConfigSource(); |
94 | // ClientStackUserSettings userSettings = new ClientStackUserSettings(); | 94 | // ClientStackUserSettings userSettings = new ClientStackUserSettings(); |
95 | // testLLUDPServer = new TestLLUDPServer(); | 95 | // testLLUDPServer = new TestLLUDPServer(); |
96 | // acm = new AgentCircuitManager(); | 96 | // acm = new AgentCircuitManager(); |
97 | // | 97 | // |
98 | // uint port = 666; | 98 | // uint port = 666; |
99 | // testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm); | 99 | // testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm); |
100 | // testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); | 100 | // testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs index 5e41dbd..873b1e5 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs | |||
@@ -137,7 +137,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
137 | Scene scene = new SceneHelpers().SetupScene(); | 137 | Scene scene = new SceneHelpers().SetupScene(); |
138 | TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene); | 138 | TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene); |
139 | 139 | ||
140 | ScenePresence sp | 140 | ScenePresence sp |
141 | = ClientStackHelpers.AddChildClient( | 141 | = ClientStackHelpers.AddChildClient( |
142 | scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); | 142 | scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); |
143 | 143 | ||
@@ -145,7 +145,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
145 | 145 | ||
146 | udpServer.Throttle.DebugLevel = 1; | 146 | udpServer.Throttle.DebugLevel = 1; |
147 | udpClient.ThrottleDebugLevel = 1; | 147 | udpClient.ThrottleDebugLevel = 1; |
148 | 148 | ||
149 | int resendBytes = 1000; | 149 | int resendBytes = 1000; |
150 | int landBytes = 2000; | 150 | int landBytes = 2000; |
151 | int windBytes = 3000; | 151 | int windBytes = 3000; |
@@ -161,8 +161,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
161 | int totalBytes = LLUDPServer.MTU + landBytes + windBytes + cloudBytes + taskBytes + textureBytes + assetBytes; | 161 | int totalBytes = LLUDPServer.MTU + landBytes + windBytes + cloudBytes + taskBytes + textureBytes + assetBytes; |
162 | 162 | ||
163 | AssertThrottles( | 163 | AssertThrottles( |
164 | udpClient, | 164 | udpClient, |
165 | LLUDPServer.MTU, landBytes, windBytes, cloudBytes, taskBytes, | 165 | LLUDPServer.MTU, landBytes, windBytes, cloudBytes, taskBytes, |
166 | textureBytes, assetBytes, totalBytes, 0, 0); | 166 | textureBytes, assetBytes, totalBytes, 0, 0); |
167 | } | 167 | } |
168 | 168 | ||
@@ -181,7 +181,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
181 | 181 | ||
182 | TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene, ics); | 182 | TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene, ics); |
183 | 183 | ||
184 | ScenePresence sp | 184 | ScenePresence sp |
185 | = ClientStackHelpers.AddChildClient( | 185 | = ClientStackHelpers.AddChildClient( |
186 | scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); | 186 | scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); |
187 | 187 | ||
@@ -207,7 +207,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
207 | double commitRatio = 32000.0 / totalBytes; | 207 | double commitRatio = 32000.0 / totalBytes; |
208 | 208 | ||
209 | AssertThrottles( | 209 | AssertThrottles( |
210 | udpClient, | 210 | udpClient, |
211 | LLUDPServer.MTU, landBytes * commitRatio, windBytes * commitRatio, cloudBytes * commitRatio, taskBytes * commitRatio, | 211 | LLUDPServer.MTU, landBytes * commitRatio, windBytes * commitRatio, cloudBytes * commitRatio, taskBytes * commitRatio, |
212 | textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0); | 212 | textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0); |
213 | 213 | ||
@@ -217,7 +217,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
217 | commitRatio = (32000.0 + 20.0 * LLUDPServer.MTU) / totalBytes; | 217 | commitRatio = (32000.0 + 20.0 * LLUDPServer.MTU) / totalBytes; |
218 | 218 | ||
219 | AssertThrottles( | 219 | AssertThrottles( |
220 | udpClient, | 220 | udpClient, |
221 | LLUDPServer.MTU, landBytes * commitRatio, windBytes * commitRatio, cloudBytes * commitRatio, taskBytes * commitRatio, | 221 | LLUDPServer.MTU, landBytes * commitRatio, windBytes * commitRatio, cloudBytes * commitRatio, taskBytes * commitRatio, |
222 | textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0); | 222 | textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0); |
223 | 223 | ||
@@ -227,7 +227,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
227 | commitRatio = (32000.0 + (20.0 * LLUDPServer.MTU)/Math.Pow(2,1)) / totalBytes; | 227 | commitRatio = (32000.0 + (20.0 * LLUDPServer.MTU)/Math.Pow(2,1)) / totalBytes; |
228 | 228 | ||
229 | AssertThrottles( | 229 | AssertThrottles( |
230 | udpClient, | 230 | udpClient, |
231 | LLUDPServer.MTU, landBytes * commitRatio, windBytes * commitRatio, cloudBytes * commitRatio, taskBytes * commitRatio, | 231 | LLUDPServer.MTU, landBytes * commitRatio, windBytes * commitRatio, cloudBytes * commitRatio, taskBytes * commitRatio, |
232 | textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0); | 232 | textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0); |
233 | } | 233 | } |
@@ -248,14 +248,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
248 | int taskBytes = 14000; | 248 | int taskBytes = 14000; |
249 | int textureBytes = 16000; | 249 | int textureBytes = 16000; |
250 | int assetBytes = 18000; | 250 | int assetBytes = 18000; |
251 | int totalBytes | 251 | int totalBytes |
252 | = (int)((resendBytes + landBytes + windBytes + cloudBytes + taskBytes + textureBytes + assetBytes) / 2); | 252 | = (int)((resendBytes + landBytes + windBytes + cloudBytes + taskBytes + textureBytes + assetBytes) / 2); |
253 | 253 | ||
254 | Scene scene = new SceneHelpers().SetupScene(); | 254 | Scene scene = new SceneHelpers().SetupScene(); |
255 | TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene); | 255 | TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene); |
256 | udpServer.Throttle.RequestedDripRate = totalBytes; | 256 | udpServer.Throttle.RequestedDripRate = totalBytes; |
257 | 257 | ||
258 | ScenePresence sp1 | 258 | ScenePresence sp1 |
259 | = ClientStackHelpers.AddChildClient( | 259 | = ClientStackHelpers.AddChildClient( |
260 | scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); | 260 | scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); |
261 | 261 | ||
@@ -265,8 +265,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
265 | udpClient1, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes); | 265 | udpClient1, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes); |
266 | 266 | ||
267 | AssertThrottles( | 267 | AssertThrottles( |
268 | udpClient1, | 268 | udpClient1, |
269 | resendBytes / 2, landBytes / 2, windBytes / 2, cloudBytes / 2, taskBytes / 2, | 269 | resendBytes / 2, landBytes / 2, windBytes / 2, cloudBytes / 2, taskBytes / 2, |
270 | textureBytes / 2, assetBytes / 2, totalBytes, 0, 0); | 270 | textureBytes / 2, assetBytes / 2, totalBytes, 0, 0); |
271 | 271 | ||
272 | // Test: Now add another client | 272 | // Test: Now add another client |
@@ -281,13 +281,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
281 | udpClient2, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes); | 281 | udpClient2, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes); |
282 | 282 | ||
283 | AssertThrottles( | 283 | AssertThrottles( |
284 | udpClient1, | 284 | udpClient1, |
285 | resendBytes / 4, landBytes / 4, windBytes / 4, cloudBytes / 4, taskBytes / 4, | 285 | resendBytes / 4, landBytes / 4, windBytes / 4, cloudBytes / 4, taskBytes / 4, |
286 | textureBytes / 4, assetBytes / 4, totalBytes / 2, 0, 0); | 286 | textureBytes / 4, assetBytes / 4, totalBytes / 2, 0, 0); |
287 | 287 | ||
288 | AssertThrottles( | 288 | AssertThrottles( |
289 | udpClient2, | 289 | udpClient2, |
290 | resendBytes / 4, landBytes / 4, windBytes / 4, cloudBytes / 4, taskBytes / 4, | 290 | resendBytes / 4, landBytes / 4, windBytes / 4, cloudBytes / 4, taskBytes / 4, |
291 | textureBytes / 4, assetBytes / 4, totalBytes / 2, 0, 0); | 291 | textureBytes / 4, assetBytes / 4, totalBytes / 2, 0, 0); |
292 | } | 292 | } |
293 | 293 | ||
@@ -307,14 +307,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
307 | int taskBytes = 12000; | 307 | int taskBytes = 12000; |
308 | int textureBytes = 14000; | 308 | int textureBytes = 14000; |
309 | int assetBytes = 16000; | 309 | int assetBytes = 16000; |
310 | int totalBytes | 310 | int totalBytes |
311 | = (int)((resendBytes + landBytes + windBytes + cloudBytes + taskBytes + textureBytes + assetBytes) / 2); | 311 | = (int)((resendBytes + landBytes + windBytes + cloudBytes + taskBytes + textureBytes + assetBytes) / 2); |
312 | 312 | ||
313 | Scene scene = new SceneHelpers().SetupScene(); | 313 | Scene scene = new SceneHelpers().SetupScene(); |
314 | TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene); | 314 | TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene); |
315 | udpServer.ThrottleRates.Total = totalBytes; | 315 | udpServer.ThrottleRates.Total = totalBytes; |
316 | 316 | ||
317 | ScenePresence sp | 317 | ScenePresence sp |
318 | = ClientStackHelpers.AddChildClient( | 318 | = ClientStackHelpers.AddChildClient( |
319 | scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); | 319 | scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); |
320 | 320 | ||
@@ -325,8 +325,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
325 | udpClient, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes); | 325 | udpClient, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes); |
326 | 326 | ||
327 | AssertThrottles( | 327 | AssertThrottles( |
328 | udpClient, | 328 | udpClient, |
329 | resendBytes / 2, landBytes / 2, windBytes / 2, cloudBytes / 2, taskBytes / 2, | 329 | resendBytes / 2, landBytes / 2, windBytes / 2, cloudBytes / 2, taskBytes / 2, |
330 | textureBytes / 2, assetBytes / 2, totalBytes, 0, totalBytes); | 330 | textureBytes / 2, assetBytes / 2, totalBytes, 0, totalBytes); |
331 | } | 331 | } |
332 | 332 | ||
@@ -352,7 +352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
352 | udpServer.ThrottleRates.Total = (int)(totalBytes * 1.1); | 352 | udpServer.ThrottleRates.Total = (int)(totalBytes * 1.1); |
353 | udpServer.Throttle.RequestedDripRate = (int)(totalBytes * 1.5); | 353 | udpServer.Throttle.RequestedDripRate = (int)(totalBytes * 1.5); |
354 | 354 | ||
355 | ScenePresence sp1 | 355 | ScenePresence sp1 |
356 | = ClientStackHelpers.AddChildClient( | 356 | = ClientStackHelpers.AddChildClient( |
357 | scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); | 357 | scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456); |
358 | 358 | ||
@@ -363,8 +363,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
363 | udpClient1, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes); | 363 | udpClient1, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes); |
364 | 364 | ||
365 | AssertThrottles( | 365 | AssertThrottles( |
366 | udpClient1, | 366 | udpClient1, |
367 | resendBytes, landBytes, windBytes, cloudBytes, taskBytes, | 367 | resendBytes, landBytes, windBytes, cloudBytes, taskBytes, |
368 | textureBytes, assetBytes, totalBytes, 0, totalBytes * 1.1); | 368 | textureBytes, assetBytes, totalBytes, 0, totalBytes * 1.1); |
369 | 369 | ||
370 | // Now add another client | 370 | // Now add another client |
@@ -379,25 +379,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
379 | udpClient2, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes); | 379 | udpClient2, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes); |
380 | 380 | ||
381 | AssertThrottles( | 381 | AssertThrottles( |
382 | udpClient1, | 382 | udpClient1, |
383 | resendBytes * 0.75, landBytes * 0.75, windBytes * 0.75, cloudBytes * 0.75, taskBytes * 0.75, | 383 | resendBytes * 0.75, landBytes * 0.75, windBytes * 0.75, cloudBytes * 0.75, taskBytes * 0.75, |
384 | textureBytes * 0.75, assetBytes * 0.75, totalBytes * 0.75, 0, totalBytes * 1.1); | 384 | textureBytes * 0.75, assetBytes * 0.75, totalBytes * 0.75, 0, totalBytes * 1.1); |
385 | 385 | ||
386 | AssertThrottles( | 386 | AssertThrottles( |
387 | udpClient2, | 387 | udpClient2, |
388 | resendBytes * 0.75, landBytes * 0.75, windBytes * 0.75, cloudBytes * 0.75, taskBytes * 0.75, | 388 | resendBytes * 0.75, landBytes * 0.75, windBytes * 0.75, cloudBytes * 0.75, taskBytes * 0.75, |
389 | textureBytes * 0.75, assetBytes * 0.75, totalBytes * 0.75, 0, totalBytes * 1.1); | 389 | textureBytes * 0.75, assetBytes * 0.75, totalBytes * 0.75, 0, totalBytes * 1.1); |
390 | } | 390 | } |
391 | 391 | ||
392 | private void AssertThrottles( | 392 | private void AssertThrottles( |
393 | LLUDPClient udpClient, | 393 | LLUDPClient udpClient, |
394 | double resendBytes, double landBytes, double windBytes, double cloudBytes, double taskBytes, double textureBytes, double assetBytes, | 394 | double resendBytes, double landBytes, double windBytes, double cloudBytes, double taskBytes, double textureBytes, double assetBytes, |
395 | double totalBytes, double targetBytes, double maxBytes) | 395 | double totalBytes, double targetBytes, double maxBytes) |
396 | { | 396 | { |
397 | ClientInfo ci = udpClient.GetClientInfo(); | 397 | ClientInfo ci = udpClient.GetClientInfo(); |
398 | 398 | ||
399 | // Console.WriteLine( | 399 | // Console.WriteLine( |
400 | // "Resend={0}, Land={1}, Wind={2}, Cloud={3}, Task={4}, Texture={5}, Asset={6}, TOTAL = {7}", | 400 | // "Resend={0}, Land={1}, Wind={2}, Cloud={3}, Task={4}, Texture={5}, Asset={6}, TOTAL = {7}", |
401 | // ci.resendThrottle, ci.landThrottle, ci.windThrottle, ci.cloudThrottle, ci.taskThrottle, ci.textureThrottle, ci.assetThrottle, ci.totalThrottle); | 401 | // ci.resendThrottle, ci.landThrottle, ci.windThrottle, ci.cloudThrottle, ci.taskThrottle, ci.textureThrottle, ci.assetThrottle, ci.totalThrottle); |
402 | 402 | ||
403 | Assert.AreEqual((int)resendBytes, ci.resendThrottle, "Resend"); | 403 | Assert.AreEqual((int)resendBytes, ci.resendThrottle, "Resend"); |