From 494a1e922dd5c86ef54d7a83347ec8ba255e0e83 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 9 Oct 2009 02:10:53 -0700 Subject: Calling .Close() on AutoResetEvent and ManualResetEvent (those classes contain an unmanaged resource that will not automatically be disposed when they are GCed), and commenting out some ManualResetEvents that are not in use yet --- OpenSim/Region/Application/OpenSimBackground.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSimBackground.cs b/OpenSim/Region/Application/OpenSimBackground.cs index ac5e241..008c6b0 100644 --- a/OpenSim/Region/Application/OpenSimBackground.cs +++ b/OpenSim/Region/Application/OpenSimBackground.cs @@ -58,6 +58,7 @@ namespace OpenSim m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : ""); WorldHasComeToAnEnd.WaitOne(); + WorldHasComeToAnEnd.Close(); } /// -- cgit v1.1 From 25878d68287d89f2d1ab1061319439d93e6119e5 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 14 Oct 2009 13:00:42 -0700 Subject: * Added the "show connections" command to print out all of the currently tracked IClientAPIs --- OpenSim/Region/Application/OpenSim.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 4d8409bb..0fcc21e 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -239,6 +239,10 @@ namespace OpenSim "show users [full]", "Show user data", HandleShow); + m_console.Commands.AddCommand("region", false, "show connections", + "show connections", + "Show connection data", HandleShow); + m_console.Commands.AddCommand("region", false, "show users full", "show users full", String.Empty, HandleShow); @@ -921,7 +925,25 @@ namespace OpenSim regionName)); } - m_log.Info(""); + m_log.Info(String.Empty); + break; + + case "connections": + System.Text.StringBuilder connections = new System.Text.StringBuilder("Connections:\n"); + m_sceneManager.ForEachScene( + delegate(Scene scene) + { + scene.ClientManager.ForEach( + delegate(IClientAPI client) + { + connections.AppendFormat("{0}: {1} ({2}) from {3} on circuit {4}\n", + scene.RegionInfo.RegionName, client.Name, client.AgentId, client.RemoteEndPoint, client.CircuitCode); + } + ); + } + ); + + m_log.Info(connections.ToString()); break; case "modules": -- cgit v1.1 From 1e9e9df0b3c2c6fad5e94db96c799bb31c193af1 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 14 Oct 2009 14:25:58 -0700 Subject: * Switched to a plain lock for the ClientManager collections and protected the TryGetValues with try/catch instead of a lock * Added ClientManager.ForEachSync() for operations that need to run synchronously, such as "show connections" --- OpenSim/Region/Application/OpenSim.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 0fcc21e..ca6a2a3 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -933,7 +933,7 @@ namespace OpenSim m_sceneManager.ForEachScene( delegate(Scene scene) { - scene.ClientManager.ForEach( + scene.ClientManager.ForEachSync( delegate(IClientAPI client) { connections.AppendFormat("{0}: {1} ({2}) from {3} on circuit {4}\n", -- cgit v1.1