本文整理汇总了C#中OpenSim.Framework.Servers.HttpServer.BaseHttpServer.Start方法的典型用法代码示例。如果您正苦于以下问题:C# BaseHttpServer.Start方法的具体用法?C# BaseHttpServer.Start怎么用?C# BaseHttpServer.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Framework.Servers.HttpServer.BaseHttpServer
的用法示例。
在下文中一共展示了BaseHttpServer.Start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartupSpecific
protected override void StartupSpecific()
{
InventoryConfig config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml")));
m_inventoryService = new GridInventoryService(config.UserServerURL);
m_inventoryService.DoLookup = config.SessionLookUp;
m_inventoryService.AddPlugin(config.DatabaseProvider, config.DatabaseConnect);
m_log.Info("[" + LogName + "]: Starting HTTP server ...");
m_httpServer = new BaseHttpServer(config.HttpPort);
AddHttpHandlers(config.RegionAccessToAgentsInventory);
m_httpServer.Start();
m_log.Info("[" + LogName + "]: Started HTTP server");
new HGInventoryService(m_inventoryService, config.AssetServerURL, config.UserServerURL, m_httpServer, config.InventoryServerURL);
base.StartupSpecific();
m_console.Commands.AddCommand("inventoryserver", false, "add user",
"add user",
"Add a random user inventory", HandleAddUser);
}
示例2: StartupSpecific
protected override void StartupSpecific()
{
SceneManager = SceneManager.Instance;
Initialize();
m_httpServer
= new BaseHttpServer(
m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort,
m_networkServersInfo.HttpSSLCN);
if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort))
{
m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
}
m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort);
m_httpServer.Start();
MainServer.AddHttpServer(m_httpServer);
MainServer.Instance = m_httpServer;
// "OOB" Server
if (m_networkServersInfo.ssl_listener)
{
if (!m_networkServersInfo.ssl_external)
{
BaseHttpServer server = new BaseHttpServer(
m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path,
m_networkServersInfo.cert_pass);
m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port);
MainServer.AddHttpServer(server);
server.Start();
}
else
{
BaseHttpServer server = new BaseHttpServer(
m_networkServersInfo.https_port);
m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port);
MainServer.AddHttpServer(server);
server.Start();
}
}
base.StartupSpecific();
}
示例3: CreateScene
public static Scene CreateScene(ushort httpPort, uint xloc, uint yloc)
{
//2130706433 = 127.0.0.1
BaseHttpServer server = new BaseHttpServer(httpPort, new System.Net.IPAddress(2130706433));
var commsManager = new OpenSim.Framework.Communications.CommunicationsManager(new OpenSim.Framework.NetworkServersInfo(), server,
new AssetCache(), new LibraryRootFolder("."));
var gridSvc = new SceneCommunicationService(commsManager);
var regionInfo = new OpenSim.Framework.RegionInfo(xloc, yloc,
new System.Net.IPEndPoint(new System.Net.IPAddress(2130706433), 9001),
"localhost");
var restComms = new RESTInterregionComms();
gridSvc.UnitTest_SetCommsOut(restComms);
Scene scene = new Scene(regionInfo, commsManager, gridSvc);
restComms.Initialise_Unittest(scene);
server.Start();
return scene;
}
示例4: RegionLoaded
public void RegionLoaded (IScene scene)
{
if (IsEnabled())
{
// Start http server
// Attach xmlrpc handlers
m_log.Info("[XMLRPC MODULE]: " +
"Starting up XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands.");
BaseHttpServer httpServer = new BaseHttpServer((uint)m_remoteDataPort, MainServer.Instance.HostName, false);
httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData);
httpServer.Start();
}
}
示例5: StartupSpecific
protected override void StartupSpecific()
{
m_storageManager = CreateStorageManager();
m_clientStackManager = CreateClientStackManager();
Initialize();
m_httpServer
= new BaseHttpServer(
m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort,
m_networkServersInfo.HttpSSLCN);
if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort))
{
m_log.Error("[HTTP]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
}
m_log.Info("[REGION]: Starting HTTP server");
m_httpServer.Start();
base.StartupSpecific();
}
示例6: PostInitialize
public void PostInitialize()
{
if (IsEnabled())
{
// Start http server
// Attach xmlrpc handlers
m_log.Info("[REMOTE_DATA]: " +
"Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands.");
BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort, null);
// XmlRpc
httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData);
// New Style
httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("llRemoteData"), XmlRpcRemoteData));
httpServer.Start();
}
}
示例7: GetHttpServer
public IHttpServer GetHttpServer (uint port, bool secure, string certPath, string certPass, SslProtocols sslProtocol)
{
if ((port == m_Port || port == 0) && HttpServer != null)
return HttpServer;
BaseHttpServer server;
if(m_Servers.TryGetValue(port, out server) && server.Secure == secure)
return server;
string hostName =
m_config.Configs["Network"].GetString("HostName", "http" + (secure ? "s" : "") + "://" + Utilities.GetExternalIp());
//Clean it up a bit
if (hostName.StartsWith("http://") || hostName.StartsWith("https://"))
hostName = hostName.Replace("https://", "").Replace("http://", "");
if (hostName.EndsWith ("/"))
hostName = hostName.Remove (hostName.Length - 1, 1);
server = new BaseHttpServer(port, hostName, secure);
try
{
if(secure)//Set these params now
server.SetSecureParams(certPath, certPass, sslProtocol);
server.Start();
}
catch(Exception)
{
//Remove the server from the list
m_Servers.Remove (port);
//Then pass the exception upwards
throw;
}
return (m_Servers[port] = server);
}
示例8: InitHttpServer
void InitHttpServer(uint port)
{
m_httpServer = new BaseHttpServer(port);
m_httpServer.Start();
m_log.Info("[ASSETINVENTORY]: AssetInventory server is listening on port " + port);
}
示例9: StartupSpecific
protected override void StartupSpecific()
{
if (m_log.IsDebugEnabled) {
m_log.DebugFormat ("{0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
}
SceneManager = SceneManager.Instance;
m_clientStackManager = CreateClientStackManager();
Initialize();
m_httpServer
= new BaseHttpServer(
m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort,
m_networkServersInfo.HttpSSLCN);
if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort))
{
m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
}
m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort);
m_httpServer.Start();
MainServer.AddHttpServer(m_httpServer);
MainServer.Instance = m_httpServer;
// "OOB" Server
if (m_networkServersInfo.ssl_listener)
{
BaseHttpServer server = new BaseHttpServer(
m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path,
m_networkServersInfo.cert_pass);
m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port);
MainServer.AddHttpServer(server);
server.Start();
}
base.StartupSpecific();
}
示例10: GetHttpServer
/// <summary>
/// Get the default http server, an http server for a specific port
/// and/or an http server bound to a specific address
/// </summary>
/// <remarks>
/// If the requested HTTP server doesn't already exist then a new one is instantiated and started.
/// </remarks>
/// <returns></returns>
/// <param name='port'>If 0 then the default HTTP server is returned.</param>
/// <param name='ipaddr'>A specific IP address to bind to. If null then the default IP address is used.</param>
public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr)
{
if (port == 0)
return instance;
if (instance != null && port == instance.Port)
return instance;
return m_Servers.GetOrAddIfNotExists(port, delegate()
{
BaseHttpServer server = new BaseHttpServer(port);
if (ipaddr != null)
server.ListenIPAddress = ipaddr;
server.Start();
return server;
});
}
示例11: StartupSpecific
protected override void StartupSpecific()
{
m_storageManager = CreateStorageManager();
m_clientStackManager = CreateClientStackManager();
Initialize();
// Main HTTP server first
m_httpServer = new BaseHttpServer(m_httpServerPort, null);
m_httpServer.HostName = m_networkServersInfo.HostName;
MainServer.AddHttpServer(m_httpServer);
m_log.InfoFormat("[REGION]: Starting HTTP server on {0}:{1}", m_httpServer.HostName, m_httpServerPort);
m_httpServer.Start();
// If specified configure an ssl server for use as well
// you need a Cert Request/Signed pair installed in the MY store with the CN specified
if (m_networkServersInfo.HttpUsesSSL)
{
if (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort)
{
m_log.Error("[HTTP]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
}
else
{
/// XXX Should also support specifying an IP Address
BaseHttpServer secureServer = new BaseHttpServer(m_networkServersInfo.httpSSLPort, null);
secureServer.HostName = m_networkServersInfo.HostName;
if (m_networkServersInfo.HttpSSLCN != null)
secureServer.SetSecureParams(m_networkServersInfo.HttpSSLCN, m_networkServersInfo.sslProtocol);
else
secureServer.SetSecureParams(m_networkServersInfo.HttpSSLCert, m_networkServersInfo.HttpSSLPassword, m_networkServersInfo.sslProtocol);
MainServer.AddHttpServer(secureServer);
m_log.Info("[REGION]: Starting HTTPS server");
secureServer.Start();
}
}
base.StartupSpecific();
}
示例12: StartupSpecific
protected override void StartupSpecific()
{
m_log.Info("[MONEY SERVER]: Starting HTTPS process");
ReadIniConfig();
try {
//Modified to work without https
//if (m_certFilename!="")
//{
// m_httpServer = new BaseHttpServer(m_moneyServerPort, true, m_certFilename, m_certPassword);
//}
//else
//{
m_httpServer = new BaseHttpServer(m_moneyServerPort, false);
//}
SetupMoneyServices();
m_httpServer.Start();
RegisterCommonCommands();
//base.StartupSpecific();
}
catch (Exception e)
{
m_log.ErrorFormat("[MONEY SERVER] StartupSpecific: Fail to start HTTPS process");
m_log.ErrorFormat("[MONEY SERVER] StartupSpecific: Please Check Certificate File or Password. Exit");
m_log.ErrorFormat("[MONEY SERVER] StartupSpecific: {0}", e);
Environment.Exit(1);
}
//TODO : Add some console commands here
}
示例13: StartupSpecific
protected override void StartupSpecific()
{
m_clientStackManager = CreateClientStackManager();
Initialize();
m_httpServer
= new BaseHttpServer(
m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort,
m_networkServersInfo.HttpSSLCN);
if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort))
{
m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
}
m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort);
m_httpServer.Start();
MainServer.Instance = m_httpServer;
base.StartupSpecific();
}
示例14: SetUpHTTPServer
private void SetUpHTTPServer()
{
uint HttpListenerPort =
(uint)m_config.Configs["Network"].GetInt("http_listener_port", (int)9000);
uint httpSSLPort =
(uint)m_config.Configs["SSLConfig"].GetInt("http_listener_sslport", (int)9001);
bool HttpUsesSSL = m_config.Configs["SSLConfig"].GetBoolean("http_listener_ssl", false);
string HttpSSLCN = m_config.Configs["SSLConfig"].GetString("http_listener_cn", "localhost");
m_BaseHTTPServer = new BaseHttpServer(
HttpListenerPort, HttpUsesSSL, httpSSLPort,
HttpSSLCN);
if (HttpUsesSSL && (HttpListenerPort == httpSSLPort))
{
m_log.Error("[HTTPSERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
}
m_log.InfoFormat("[HTTPSERVER]: Starting HTTP server on port {0}", HttpListenerPort);
m_BaseHTTPServer.Start();
MainServer.Instance = m_BaseHTTPServer;
}
示例15: OpenSimBase
/// <summary>
/// Default constructor
/// </summary>
public OpenSimBase(IConfigSource configSource)
{
m_startuptime = DateTime.Now;
m_version = VersionInfo.Version;
// Random uuid for private data
m_osSecret = UUID.Random().ToString();
m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics);
m_periodicDiagnosticsTimer.Enabled = true;
// This thread will go on to become the console listening thread
Thread.CurrentThread.Name = "ConsoleThread";
ILoggerRepository repository = LogManager.GetRepository();
IAppender[] appenders = repository.GetAppenders();
foreach (IAppender appender in appenders)
{
if (appender.Name == "LogFileAppender")
{
m_logFileAppender = appender;
}
}
LoadConfigSettings(configSource);
m_clientStackManager = CreateClientStackManager();
Initialize();
m_httpServer = new BaseHttpServer(
m_httpServerPort, m_configSettings.HttpUsesSSL, m_configSettings.httpSSLPort,
m_configSettings.HttpSSLCN);
if (m_configSettings.HttpUsesSSL && (m_configSettings.HttpListenerPort == m_configSettings.httpSSLPort))
{
m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
}
m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort);
m_httpServer.Start();
MainServer.Instance = m_httpServer;
}