* Read scene_throttle_bps from the config file and use it
* Minor formatting cleanupprioritization
parent
4b5a2f8c02
commit
c033477d2f
|
@ -184,7 +184,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
int sent;
|
int sent;
|
||||||
bool imageDone = image.SendPackets(m_client, packetsToSend - packetsSent, out sent);
|
bool imageDone = image.SendPackets(m_client, packetsToSend - packetsSent, out sent);
|
||||||
|
|
||||||
packetsSent += sent;
|
packetsSent += sent;
|
||||||
|
|
||||||
// If the send is complete, destroy any knowledge of this transfer
|
// If the send is complete, destroy any knowledge of this transfer
|
||||||
|
@ -234,20 +233,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
image.PriorityQueueHandle = null;
|
image.PriorityQueueHandle = null;
|
||||||
|
|
||||||
lock (m_syncRoot)
|
lock (m_syncRoot)
|
||||||
try
|
try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); }
|
||||||
{
|
|
||||||
m_priorityQueue.Add(ref image.PriorityQueueHandle, image);
|
|
||||||
}
|
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveImageFromQueue(J2KImage image)
|
void RemoveImageFromQueue(J2KImage image)
|
||||||
{
|
{
|
||||||
lock (m_syncRoot)
|
lock (m_syncRoot)
|
||||||
try
|
try { m_priorityQueue.Delete(image.PriorityQueueHandle); }
|
||||||
{
|
|
||||||
m_priorityQueue.Delete(image.PriorityQueueHandle);
|
|
||||||
}
|
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,15 +138,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
#endregion Environment.TickCount Measurement
|
#endregion Environment.TickCount Measurement
|
||||||
|
|
||||||
m_circuitManager = circuitManager;
|
m_circuitManager = circuitManager;
|
||||||
|
int sceneThrottleBps = 0;
|
||||||
|
|
||||||
IConfig config = configSource.Configs["ClientStack.LindenUDP"];
|
IConfig config = configSource.Configs["ClientStack.LindenUDP"];
|
||||||
if (config != null)
|
if (config != null)
|
||||||
{
|
{
|
||||||
m_recvBufferSize = config.GetInt("client_socket_rcvbuf_size", 0);
|
m_recvBufferSize = config.GetInt("client_socket_rcvbuf_size", 0);
|
||||||
|
sceneThrottleBps = config.GetInt("scene_throttle_max_bps", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Config support for throttling the entire connection
|
// TODO: Config support for throttling the entire connection
|
||||||
m_throttle = new TokenBucket(null, 0, 0);
|
m_throttle = new TokenBucket(null, sceneThrottleBps, sceneThrottleBps);
|
||||||
m_throttleRates = new ThrottleRates(configSource);
|
m_throttleRates = new ThrottleRates(configSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue