Add MainServer.GetHttpServer(port) method for using multiple listener
ports in region modulesprioritization
parent
26863c04a5
commit
9bc303d293
|
@ -26,17 +26,34 @@
|
|||
*/
|
||||
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
public class MainServer
|
||||
{
|
||||
private static BaseHttpServer instance;
|
||||
private static Dictionary<uint, BaseHttpServer> m_Servers =
|
||||
new Dictionary<uint, BaseHttpServer>();
|
||||
|
||||
public static BaseHttpServer Instance
|
||||
{
|
||||
get { return instance; }
|
||||
set { instance = value; }
|
||||
}
|
||||
|
||||
public IHttpServer GetHttpServer(uint port)
|
||||
{
|
||||
if (port == Instance.Port)
|
||||
return Instance;
|
||||
|
||||
if (m_Servers.ContainsKey(port))
|
||||
return m_Servers[port];
|
||||
|
||||
m_Servers[port] = new BaseHttpServer(port);
|
||||
m_Servers[port].Start();
|
||||
|
||||
return m_Servers[port];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue