diff options
author | Melanie | 2009-10-20 16:57:22 +0100 |
---|---|---|
committer | Melanie | 2009-10-20 16:57:22 +0100 |
commit | 9bc303d2937ab2f62e146f7fdde6444ed8cb50c9 (patch) | |
tree | 211b0aafe1730c9c8df1d9fc8f3206286e07a062 /OpenSim/Framework/MainServer.cs | |
parent | Change "config save" to "config save <filename>", which is mandatory. (diff) | |
download | opensim-SC_OLD-9bc303d2937ab2f62e146f7fdde6444ed8cb50c9.zip opensim-SC_OLD-9bc303d2937ab2f62e146f7fdde6444ed8cb50c9.tar.gz opensim-SC_OLD-9bc303d2937ab2f62e146f7fdde6444ed8cb50c9.tar.bz2 opensim-SC_OLD-9bc303d2937ab2f62e146f7fdde6444ed8cb50c9.tar.xz |
Add MainServer.GetHttpServer(port) method for using multiple listener
ports in region modules
Diffstat (limited to 'OpenSim/Framework/MainServer.cs')
-rw-r--r-- | OpenSim/Framework/MainServer.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Framework/MainServer.cs b/OpenSim/Framework/MainServer.cs index b5f947e..21033b3 100644 --- a/OpenSim/Framework/MainServer.cs +++ b/OpenSim/Framework/MainServer.cs | |||
@@ -26,17 +26,34 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using OpenSim.Framework.Servers.HttpServer; | 28 | using OpenSim.Framework.Servers.HttpServer; |
29 | using System.Collections.Generic; | ||
29 | 30 | ||
30 | namespace OpenSim.Framework | 31 | namespace OpenSim.Framework |
31 | { | 32 | { |
32 | public class MainServer | 33 | public class MainServer |
33 | { | 34 | { |
34 | private static BaseHttpServer instance; | 35 | private static BaseHttpServer instance; |
36 | private static Dictionary<uint, BaseHttpServer> m_Servers = | ||
37 | new Dictionary<uint, BaseHttpServer>(); | ||
35 | 38 | ||
36 | public static BaseHttpServer Instance | 39 | public static BaseHttpServer Instance |
37 | { | 40 | { |
38 | get { return instance; } | 41 | get { return instance; } |
39 | set { instance = value; } | 42 | set { instance = value; } |
40 | } | 43 | } |
44 | |||
45 | public IHttpServer GetHttpServer(uint port) | ||
46 | { | ||
47 | if (port == Instance.Port) | ||
48 | return Instance; | ||
49 | |||
50 | if (m_Servers.ContainsKey(port)) | ||
51 | return m_Servers[port]; | ||
52 | |||
53 | m_Servers[port] = new BaseHttpServer(port); | ||
54 | m_Servers[port].Start(); | ||
55 | |||
56 | return m_Servers[port]; | ||
57 | } | ||
41 | } | 58 | } |
42 | } | 59 | } |