aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/MainServer.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-06-15 00:40:12 +0100
committerJustin Clark-Casey (justincc)2012-06-15 00:40:12 +0100
commit6993a26ba599ae38dc6f66332980657d5621987a (patch)
tree7e055b0d22bb47bca6ca94ae185cc1525b484374 /OpenSim/Framework/Servers/MainServer.cs
parentminor: Extend 'debug http' usage statement to 0..3 from 0..2 (diff)
downloadopensim-SC_OLD-6993a26ba599ae38dc6f66332980657d5621987a.zip
opensim-SC_OLD-6993a26ba599ae38dc6f66332980657d5621987a.tar.gz
opensim-SC_OLD-6993a26ba599ae38dc6f66332980657d5621987a.tar.bz2
opensim-SC_OLD-6993a26ba599ae38dc6f66332980657d5621987a.tar.xz
Get rid of some unnecessary null checks in RegionApplicationBase.StartupSpecific() - a constructor can never return null.
Also adds some method doc to MainServer
Diffstat (limited to 'OpenSim/Framework/Servers/MainServer.cs')
-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