aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs14
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs5
2 files changed, 14 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 9d182b6..0e67095 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -2066,6 +2066,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2066 while (base.IsRunningOutbound) 2066 while (base.IsRunningOutbound)
2067 { 2067 {
2068 Scene.ThreadAlive(2); 2068 Scene.ThreadAlive(2);
2069
2070
2069 try 2071 try
2070 { 2072 {
2071 m_packetSent = false; 2073 m_packetSent = false;
@@ -2125,11 +2127,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2125 // If nothing was sent, sleep for the minimum amount of time before a 2127 // If nothing was sent, sleep for the minimum amount of time before a
2126 // token bucket could get more tokens 2128 // token bucket could get more tokens
2127 2129
2128 if (!m_packetSent) 2130 if(Scene.GetNumberOfClients() == 0)
2129 Thread.Sleep((int)TickCountResolution); 2131 {
2130 2132 Thread.Sleep(250); // be friendly to PIs, but how long ??
2131 // .... wrong core code removed 2133 }
2132 2134 else if (!m_packetSent)
2135// Thread.Sleep((int)TickCountResolution); outch this is bad on linux
2136 Thread.Sleep(15); // match the 16ms of windows7, dont ask 16 or win may decide to do 32ms.
2133 2137
2134 Watchdog.UpdateThread(); 2138 Watchdog.UpdateThread();
2135 } 2139 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index cf5705c..fac5547 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5409,6 +5409,11 @@ Label_GroupsDone:
5409 m_clientManager.ForEachSync(action); 5409 m_clientManager.ForEachSync(action);
5410 } 5410 }
5411 5411
5412 public int GetNumberOfClients()
5413 {
5414 return m_clientManager.Count;
5415 }
5416
5412 public bool TryGetClient(UUID avatarID, out IClientAPI client) 5417 public bool TryGetClient(UUID avatarID, out IClientAPI client)
5413 { 5418 {
5414 return m_clientManager.TryGetValue(avatarID, out client); 5419 return m_clientManager.TryGetValue(avatarID, out client);