本文整理汇总了C#中OpenSim.Framework.Servers.HttpServer.BaseHttpServer类的典型用法代码示例。如果您正苦于以下问题:C# BaseHttpServer类的具体用法?C# BaseHttpServer怎么用?C# BaseHttpServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseHttpServer类属于OpenSim.Framework.Servers.HttpServer命名空间,在下文中一共展示了BaseHttpServer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PollServiceRequestManager
// private int m_timeout = 1000; // increase timeout 250; now use the event one
public PollServiceRequestManager(
BaseHttpServer pSrv, bool performResponsesAsync, uint pWorkerThreadCount, int pTimeout)
{
m_server = pSrv;
PerformResponsesAsync = performResponsesAsync;
m_WorkerThreadCount = pWorkerThreadCount;
m_workerThreads = new Thread[m_WorkerThreadCount];
StatsManager.RegisterStat(
new Stat(
"QueuedPollResponses",
"Number of poll responses queued for processing.",
"",
"",
"httpserver",
m_server.Port.ToString(),
StatType.Pull,
MeasuresOfInterest.AverageChangeOverTime,
stat => stat.Value = m_requests.Count(),
StatVerbosity.Debug));
StatsManager.RegisterStat(
new Stat(
"ProcessedPollResponses",
"Number of poll responses processed.",
"",
"",
"httpserver",
m_server.Port.ToString(),
StatType.Pull,
MeasuresOfInterest.AverageChangeOverTime,
stat => stat.Value = ResponsesProcessed,
StatVerbosity.Debug));
}
示例2: RegisterHandlers
public void RegisterHandlers(BaseHttpServer httpServer)
{
m_httpServer = httpServer;
m_httpServer.AddXmlRPCHandler("get_avatar_appearance", XmlRPCGetAvatarAppearance);
m_httpServer.AddXmlRPCHandler("update_avatar_appearance", XmlRPCUpdateAvatarAppearance);
}
示例3: TestChildAgentSingleRegionCapabilities
public void TestChildAgentSingleRegionCapabilities()
{
TestHelpers.InMethod();
// TestHelpers.EnableLogging();
UUID spUuid = TestHelpers.ParseTail(0x1);
// XXX: This is not great since the use of statics will mean that this has to be manually cleaned up for
// any subsequent test.
// XXX: May replace with a mock IHttpServer later.
BaseHttpServer httpServer = new BaseHttpServer(99999);
MainServer.AddHttpServer(httpServer);
MainServer.Instance = httpServer;
CapabilitiesModule capsMod = new CapabilitiesModule();
TestScene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, capsMod);
ScenePresence sp = SceneHelpers.AddChildScenePresence(scene, spUuid);
Assert.That(capsMod.GetCapsForUser(spUuid), Is.Not.Null);
// TODO: Need to add tests for other ICapabiltiesModule methods.
scene.CloseAgent(sp.UUID, false);
Assert.That(capsMod.GetCapsForUser(spUuid), Is.Null);
// TODO: Need to add tests for other ICapabiltiesModule methods.
}
示例4: ReadConfig
protected override void ReadConfig()
{
IConfig networkConfig = m_Config.Configs["Network"];
if (networkConfig == null)
{
System.Console.WriteLine("Section 'Network' not found, server can't start");
Thread.CurrentThread.Abort();
}
uint port = (uint)networkConfig.GetInt("port", 0);
if (port == 0)
{
System.Console.WriteLine("Port number not specified or 0, server can't start");
Thread.CurrentThread.Abort();
}
m_HttpServer = new BaseHttpServer(port);
MainServer.Instance = m_HttpServer;
if (MainConsole.Instance is RemoteConsole)
{
((RemoteConsole)MainConsole.Instance).SetServer(m_HttpServer);
}
}
示例5: PollServiceRequestManager
public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout)
{
m_server = pSrv;
m_WorkerThreadCount = pWorkerThreadCount;
m_workerThreads = new Thread[m_WorkerThreadCount];
m_PollServiceWorkerThreads = new PollServiceWorkerThread[m_WorkerThreadCount];
//startup worker threads
for (uint i = 0; i < m_WorkerThreadCount; i++)
{
m_PollServiceWorkerThreads[i] = new PollServiceWorkerThread(m_server, pTimeout);
m_PollServiceWorkerThreads[i].ReQueue += ReQueueEvent;
m_workerThreads[i]
= Watchdog.StartThread(
m_PollServiceWorkerThreads[i].ThreadStart,
String.Format("PollServiceWorkerThread{0}", i),
ThreadPriority.Normal,
false,
true,
null,
int.MaxValue);
}
Watchdog.StartThread(
this.ThreadStart,
"PollServiceWatcherThread",
ThreadPriority.Normal,
false,
true,
null,
1000 * 60 * 10);
}
示例6: HGCommunicationsStandalone
public HGCommunicationsStandalone(
ConfigSettings configSettings,
NetworkServersInfo serversInfo,
BaseHttpServer httpServer,
HGGridServices gridService,
LibraryRootFolder libraryRootFolder,
bool dumpAssetsToFile)
: base(serversInfo, libraryRootFolder)
{
LocalUserServices localUserService =
new LocalUserServices(
serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
localUserService.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource);
HGUserServices hgUserService = new HGUserServices(this, localUserService);
// This plugin arrangement could eventually be configurable rather than hardcoded here.
hgUserService.AddPlugin(new TemporaryUserProfilePlugin());
hgUserService.AddPlugin(new HGUserDataPlugin(this, hgUserService));
m_userService = hgUserService;
m_userAdminService = hgUserService;
m_avatarService = hgUserService;
m_messageService = hgUserService;
gridService.UserProfileCache = m_userProfileCacheService;
m_gridService = gridService;
}
示例7: PollServiceRequestManager
public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout)
{
m_server = pSrv;
m_WorkerThreadCount = pWorkerThreadCount;
m_workerThreads = new Thread[m_WorkerThreadCount];
m_PollServiceWorkerThreads = new PollServiceWorkerThread[m_WorkerThreadCount];
//startup worker threads
for (uint i=0;i<m_WorkerThreadCount;i++)
{
m_PollServiceWorkerThreads[i] = new PollServiceWorkerThread(m_server, pTimeout);
m_PollServiceWorkerThreads[i].ReQueue += ReQueueEvent;
m_workerThreads[i] = new Thread(m_PollServiceWorkerThreads[i].ThreadStart);
m_workerThreads[i].Name = String.Format("PollServiceWorkerThread{0}",i);
//Can't add to thread Tracker here Referencing OpenSim.Framework creates circular reference
m_workerThreads[i].Start();
}
//start watcher threads
m_watcherThread = new Thread(ThreadStart);
m_watcherThread.Name = "PollServiceWatcherThread";
m_watcherThread.Start();
}
示例8: SetupNeighbourRegions
private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB)
{
// XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the
// CapabilitiesModule complain when it can't set up HTTP endpoints.
BaseHttpServer httpServer = new BaseHttpServer(99999);
MainServer.AddHttpServer(httpServer);
MainServer.Instance = httpServer;
// We need entity transfer modules so that when sp2 logs into the east region, the region calls
// EntityTransferModuleto set up a child agent on the west region.
// XXX: However, this is not an entity transfer so is misleading.
EntityTransferModule etmA = new EntityTransferModule();
EntityTransferModule etmB = new EntityTransferModule();
LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
IConfigSource config = new IniConfigSource();
config.AddConfig("Chat");
IConfig modulesConfig = config.AddConfig("Modules");
modulesConfig.Set("EntityTransferModule", etmA.Name);
modulesConfig.Set("SimulationServices", lscm.Name);
SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule());
SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule());
}
示例9: SetUp
public override void SetUp()
{
base.SetUp();
uint port = 9999;
uint sslPort = 9998;
// This is an unfortunate bit of clean up we have to do because MainServer manages things through static
// variables and the VM is not restarted between tests.
MainServer.RemoveHttpServer(port);
BaseHttpServer server = new BaseHttpServer(port, false, sslPort, "");
MainServer.AddHttpServer(server);
MainServer.Instance = server;
IConfigSource config = new IniConfigSource();
config.AddConfig("Startup");
config.Configs["Startup"].Set("EventQueue", "true");
CapabilitiesModule capsModule = new CapabilitiesModule();
EventQueueGetModule eqgModule = new EventQueueGetModule();
m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule);
}
示例10: CommunicationsLocal
public CommunicationsLocal(
ConfigSettings configSettings,
NetworkServersInfo serversInfo,
BaseHttpServer httpServer,
IAssetCache assetCache,
LibraryRootFolder libraryRootFolder)
: base(serversInfo, httpServer, assetCache, libraryRootFolder)
{
PluginLoader<IInventoryStoragePlugin> loader = new PluginLoader<IInventoryStoragePlugin>();
loader.Add("/OpenSim/InventoryStorage", new PluginProviderFilter(configSettings.InventoryPlugin));
loader.Load();
loader.Plugin.Initialize(configSettings);
LocalUserServices lus
= new LocalUserServices(
serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
//lus.AddPlugin(new TemporaryUserProfilePlugin());
lus.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource);
m_userService = lus;
m_userAdminService = lus;
m_avatarService = lus;
m_messageService = lus;
m_gridService = new LocalBackEndServices();
}
示例11: 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);
}
示例12: RegisterHandlers
public void RegisterHandlers(BaseHttpServer httpServer)
{
m_httpServer = httpServer;
m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info",
m_gridInfoService.RestGetGridInfoMethod));
m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod);
}
示例13: RegisterHandlers
public void RegisterHandlers(BaseHttpServer httpServer)
{
m_httpServer = httpServer;
httpServer.AddXmlRPCHandler("hg_login", XmlRpcLoginMethod);
httpServer.AddXmlRPCHandler("hg_new_auth_key", XmlRpcGenerateKeyMethod);
httpServer.AddXmlRPCHandler("hg_verify_auth_key", XmlRpcVerifyKeyMethod);
}
示例14: PollServiceRequestManager
public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout)
{
m_server = pSrv;
m_WorkerThreadCount = pWorkerThreadCount;
m_workerThreads = new Thread[m_WorkerThreadCount];
m_PollServiceWorkerThreads = new PollServiceWorkerThread[m_WorkerThreadCount];
m_timeOut = pTimeout;
}
示例15: RegisterHandlers
public void RegisterHandlers(BaseHttpServer httpServer)
{
m_httpServer = httpServer;
m_httpServer.AddXmlRPCHandler("add_new_user_friend", XmlRpcResponseXmlRPCAddUserFriend);
m_httpServer.AddXmlRPCHandler("remove_user_friend", XmlRpcResponseXmlRPCRemoveUserFriend);
m_httpServer.AddXmlRPCHandler("update_user_friend_perms", XmlRpcResponseXmlRPCUpdateUserFriendPerms);
m_httpServer.AddXmlRPCHandler("get_user_friend_list", XmlRpcResponseXmlRPCGetUserFriendList);
}