aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-03 18:06:45 +0000
committerJustin Clarke Casey2008-10-03 18:06:45 +0000
commit743e336bf340f623a50bebd53d98798c04eb0345 (patch)
treed6a0055ff71d99e7c0e132bb7ae51d0922949e0c /OpenSim/Region/ClientStack/LindenUDP
parentCause objects to be removed from the database when they go temp or get (diff)
downloadopensim-SC_OLD-743e336bf340f623a50bebd53d98798c04eb0345.zip
opensim-SC_OLD-743e336bf340f623a50bebd53d98798c04eb0345.tar.gz
opensim-SC_OLD-743e336bf340f623a50bebd53d98798c04eb0345.tar.bz2
opensim-SC_OLD-743e336bf340f623a50bebd53d98798c04eb0345.tar.xz
* Put in some infrastructure to allow tweaking of packet queue throttle values for the total throttle (the one that throttles all packet output)
* Not complete yet
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs4
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs19
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs13
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs16
4 files changed, 37 insertions, 15 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
index 78a916d..da62a80 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
@@ -219,12 +219,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
219 219
220 // Constructors 220 // Constructors
221 // 221 //
222 public LLPacketHandler(IClientAPI client, LLPacketServer server) 222 public LLPacketHandler(IClientAPI client, LLPacketServer server, ClientStackUserSettings userSettings)
223 { 223 {
224 m_Client = client; 224 m_Client = client;
225 m_PacketServer = server; 225 m_PacketServer = server;
226 226
227 m_PacketQueue = new LLPacketQueue(client.AgentId); 227 m_PacketQueue = new LLPacketQueue(client.AgentId, userSettings);
228 228
229 m_AckTimer.Elapsed += AckTimerElapsed; 229 m_AckTimer.Elapsed += AckTimerElapsed;
230 m_AckTimer.Start(); 230 m_AckTimer.Start();
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
index e4e5e9a..1e03c88 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
@@ -34,6 +34,7 @@ using OpenMetaverse.Packets;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Statistics; 35using OpenSim.Framework.Statistics;
36using OpenSim.Framework.Statistics.Interfaces; 36using OpenSim.Framework.Statistics.Interfaces;
37using OpenSim.Region.ClientStack;
37using Timer=System.Timers.Timer; 38using Timer=System.Timers.Timer;
38 39
39 40
@@ -45,7 +46,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
45 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 46 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
46 47
47 /// <summary> 48 /// <summary>
48 /// Is throttling enabled at all? 49 /// Is queueing enabled at all?
49 /// </summary> 50 /// </summary>
50 private bool m_enabled = true; 51 private bool m_enabled = true;
51 52
@@ -88,7 +89,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
88 89
89 private UUID m_agentId; 90 private UUID m_agentId;
90 91
91 public LLPacketQueue(UUID agentId) 92 public LLPacketQueue(UUID agentId, ClientStackUserSettings userSettings)
92 { 93 {
93 // While working on this, the BlockingQueue had me fooled for a bit. 94 // While working on this, the BlockingQueue had me fooled for a bit.
94 // The Blocking queue causes the thread to stop until there's something 95 // The Blocking queue causes the thread to stop until there's something
@@ -108,7 +109,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
108 TextureOutgoingPacketQueue = new Queue<LLQueItem>(); 109 TextureOutgoingPacketQueue = new Queue<LLQueItem>();
109 AssetOutgoingPacketQueue = new Queue<LLQueItem>(); 110 AssetOutgoingPacketQueue = new Queue<LLQueItem>();
110 111
111
112 // Set up the throttle classes (min, max, current) in bytes 112 // Set up the throttle classes (min, max, current) in bytes
113 ResendThrottle = new LLPacketThrottle(5000, 100000, 16000); 113 ResendThrottle = new LLPacketThrottle(5000, 100000, 16000);
114 LandThrottle = new LLPacketThrottle(1000, 100000, 2000); 114 LandThrottle = new LLPacketThrottle(1000, 100000, 2000);
@@ -117,9 +117,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
117 TaskThrottle = new LLPacketThrottle(1000, 800000, 3000); 117 TaskThrottle = new LLPacketThrottle(1000, 800000, 3000);
118 AssetThrottle = new LLPacketThrottle(1000, 800000, 1000); 118 AssetThrottle = new LLPacketThrottle(1000, 800000, 1000);
119 TextureThrottle = new LLPacketThrottle(1000, 800000, 4000); 119 TextureThrottle = new LLPacketThrottle(1000, 800000, 4000);
120
120 // Total Throttle trumps all 121 // Total Throttle trumps all
121 // Number of bytes allowed to go out per second. (256kbps per client) 122 // Number of bytes allowed to go out per second.
122 TotalThrottle = new LLPacketThrottle(0, 1500000, 28000); 123 ThrottleSettings totalThrottleSettings = userSettings.TotalThrottleSettings;
124 if (null == totalThrottleSettings)
125 {
126 totalThrottleSettings = new ThrottleSettings(0, 1500000, 28000);
127 }
128
129 TotalThrottle
130 = new LLPacketThrottle(
131 totalThrottleSettings.Min, totalThrottleSettings.Max, totalThrottleSettings.Current);
123 132
124 throttleTimer = new Timer((int) (throttletimems/throttleTimeDivisor)); 133 throttleTimer = new Timer((int) (throttletimems/throttleTimeDivisor));
125 throttleTimer.Elapsed += new ElapsedEventHandler(ThrottleTimerElapsed); 134 throttleTimer.Elapsed += new ElapsedEventHandler(ThrottleTimerElapsed);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
index 1261666..e2d2226 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs
@@ -47,10 +47,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
47 //{ 47 //{
48 // get { return m_clientManager; } 48 // get { return m_clientManager; }
49 //} 49 //}
50
51 /// <summary>
52 /// Tweakable user settings
53 /// </summary>
54 private ClientStackUserSettings m_userSettings;
50 55
51 public LLPacketServer(ILLClientStackNetworkHandler networkHandler) 56 public LLPacketServer(ILLClientStackNetworkHandler networkHandler, ClientStackUserSettings userSettings)
52 { 57 {
58 m_userSettings = userSettings;
53 m_networkHandler = networkHandler; 59 m_networkHandler = networkHandler;
60
54 m_networkHandler.RegisterPacketServer(this); 61 m_networkHandler.RegisterPacketServer(this);
55 } 62 }
56 63
@@ -90,7 +97,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
90 UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP) 97 UUID agentId, UUID sessionId, uint circuitCode, EndPoint proxyEP)
91 { 98 {
92 return 99 return
93 new LLClientView(remoteEP, scene, assetCache, packServer, authenSessions, agentId, sessionId, circuitCode, proxyEP); 100 new LLClientView(
101 remoteEP, scene, assetCache, packServer, authenSessions, agentId, sessionId, circuitCode, proxyEP,
102 m_userSettings);
94 } 103 }
95 104
96 /// <summary> 105 /// <summary>
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index c20c7bc..8643382 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -130,9 +130,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
130 { 130 {
131 } 131 }
132 132
133 public LLUDPServer(IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, AssetCache assetCache, AgentCircuitManager authenticateClass) 133 public LLUDPServer(
134 IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, ClientStackUserSettings userSettings,
135 AssetCache assetCache, AgentCircuitManager authenticateClass)
134 { 136 {
135 Initialise(_listenIP, ref port, proxyPortOffset, allow_alternate_port, assetCache, authenticateClass); 137 Initialise(_listenIP, ref port, proxyPortOffset, allow_alternate_port, userSettings, assetCache, authenticateClass);
136 } 138 }
137 139
138 /// <summary> 140 /// <summary>
@@ -142,10 +144,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
142 /// <param name="port"></param> 144 /// <param name="port"></param>
143 /// <param name="proxyPortOffsetParm"></param> 145 /// <param name="proxyPortOffsetParm"></param>
144 /// <param name="allow_alternate_port"></param> 146 /// <param name="allow_alternate_port"></param>
147 /// <param name="settings"></param>
145 /// <param name="assetCache"></param> 148 /// <param name="assetCache"></param>
146 /// <param name="circuitManager"></param> 149 /// <param name="circuitManager"></param>
147 public void Initialise( 150 public void Initialise(
148 IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, AssetCache assetCache, AgentCircuitManager circuitManager) 151 IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, ClientStackUserSettings userSettings,
152 AssetCache assetCache, AgentCircuitManager circuitManager)
149 { 153 {
150 proxyPortOffset = proxyPortOffsetParm; 154 proxyPortOffset = proxyPortOffsetParm;
151 listenPort = (uint) (port + proxyPortOffsetParm); 155 listenPort = (uint) (port + proxyPortOffsetParm);
@@ -153,7 +157,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
153 Allow_Alternate_Port = allow_alternate_port; 157 Allow_Alternate_Port = allow_alternate_port;
154 m_assetCache = assetCache; 158 m_assetCache = assetCache;
155 m_circuitManager = circuitManager; 159 m_circuitManager = circuitManager;
156 CreatePacketServer(); 160 CreatePacketServer(userSettings);
157 161
158 // Return new port 162 // Return new port
159 // This because in Grid mode it is not really important what port the region listens to as long as it is correctly registered. 163 // This because in Grid mode it is not really important what port the region listens to as long as it is correctly registered.
@@ -161,9 +165,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
161 port = (uint)(listenPort - proxyPortOffsetParm); 165 port = (uint)(listenPort - proxyPortOffsetParm);
162 } 166 }
163 167
164 protected virtual void CreatePacketServer() 168 protected virtual void CreatePacketServer(ClientStackUserSettings userSettings)
165 { 169 {
166 new LLPacketServer(this); 170 new LLPacketServer(this, userSettings);
167 } 171 }
168 172
169 /// <summary> 173 /// <summary>