aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/MainServer.cs31
1 files changed, 27 insertions, 4 deletions
diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs
index b8ab8d9..ea972ef 100644
--- a/OpenSim/Framework/Servers/MainServer.cs
+++ b/OpenSim/Framework/Servers/MainServer.cs
@@ -47,20 +47,43 @@ namespace OpenSim.Framework.Servers
47 set { instance = value; } 47 set { instance = value; }
48 } 48 }
49 49
50 public static IHttpServer GetHttpServer(uint port) 50 /// <summary>
51 /// Add an already started HTTP server to the collection of known servers.
52 /// </summary>
53 /// <param name='server'></param>
54 public static void AddHttpServer(BaseHttpServer server)
51 { 55 {
52 return GetHttpServer(port,null); 56 m_Servers.Add(server.Port, server);
53 } 57 }
54 58
55 public static void AddHttpServer(BaseHttpServer server) 59 /// <summary>
60 /// Get the default http server or an http server for a specific port.
61 /// </summary>
62 /// <remarks>
63 /// If the requested HTTP server doesn't already exist then a new one is instantiated and started.
64 /// </remarks>
65 /// <returns></returns>
66 /// <param name='port'>If 0 then the default HTTP server is returned.</param>
67 public static IHttpServer GetHttpServer(uint port)
56 { 68 {
57 m_Servers.Add(server.Port, server); 69 return GetHttpServer(port, null);
58 } 70 }
59 71
72 /// <summary>
73 /// Get the default http server, an http server for a specific port
74 /// and/or an http server bound to a specific address
75 /// </summary>
76 /// <remarks>
77 /// If the requested HTTP server doesn't already exist then a new one is instantiated and started.
78 /// </remarks>
79 /// <returns></returns>
80 /// <param name='port'>If 0 then the default HTTP server is returned.</param>
81 /// <param name='ipaddr'>A specific IP address to bind to. If null then the default IP address is used.</param>
60 public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr) 82 public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr)
61 { 83 {
62 if (port == 0) 84 if (port == 0)
63 return Instance; 85 return Instance;
86
64 if (instance != null && port == Instance.Port) 87 if (instance != null && port == Instance.Port)
65 return Instance; 88 return Instance;
66 89