本文整理汇总了C#中IHttpServer类的典型用法代码示例。如果您正苦于以下问题:C# IHttpServer类的具体用法?C# IHttpServer怎么用?C# IHttpServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IHttpServer类属于命名空间,在下文中一共展示了IHttpServer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: UploadBakedTextureServerConnector
public UploadBakedTextureServerConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
if (configName != String.Empty)
m_ConfigName = configName;
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
string assetService = serverConfig.GetString("AssetService", String.Empty);
if (assetService == String.Empty)
throw new Exception("No AssetService in config file");
Object[] args = new Object[] { config };
m_AssetService =
ServerUtils.LoadPlugin<IAssetService>(assetService, args);
if (m_AssetService == null)
throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
// NEED TO FIX THIS
OpenSim.Framework.Capabilities.Caps caps = new OpenSim.Framework.Capabilities.Caps(server, "", server.Port, "", UUID.Zero, "");
server.AddStreamHandler(new RestStreamHandler(
"POST",
"/CAPS/UploadBakedTexture/",
new UploadBakedTextureHandler(caps, m_AssetService, true).UploadBakedTexture,
"UploadBakedTexture",
"Upload Baked Texture Capability"));
}
开发者ID:CassieEllen,项目名称:opensim,代码行数:32,代码来源:UploadBakedTextureServerConnector.cs
示例2: InitializeHandlers
private void InitializeHandlers(IHttpServer server)
{
LLLoginHandlers loginHandlers = new LLLoginHandlers(m_LoginService, m_Config, m_Proxy);
server.AddXmlRPCHandler("login_to_simulator", loginHandlers.HandleXMLRPCLogin, false);
server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false);
server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin);
}
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:7,代码来源:LLLoginServiceInConnector.cs
示例3: Start
public void Start(IScene scene)
{
m_scene = scene;
m_assetClient = m_scene.Simian.GetAppModule<IAssetClient>();
if (m_assetClient == null)
{
m_log.Warn("Upload requires an IAssetClient");
return;
}
m_httpServer = m_scene.Simian.GetAppModule<IHttpServer>();
if (m_httpServer == null)
{
m_log.Warn("Upload requires an IHttpServer");
return;
}
m_primMesher = m_scene.GetSceneModule<IPrimMesher>();
m_permissions = m_scene.GetSceneModule<LLPermissions>();
m_scene.Capabilities.AddProtectedResource(m_scene.ID, "UploadBakedTexture", UploadBakedTextureHandler);
m_scene.Capabilities.AddProtectedResource(m_scene.ID, "UploadBakedTextureData", UploadBakedTextureDataHandler);
m_scene.Capabilities.AddProtectedResource(m_scene.ID, "UploadObjectAsset", UploadObjectAssetHandler);
}
开发者ID:thoys,项目名称:simian,代码行数:25,代码来源:Upload.cs
示例4: HGInventoryService
// Constructor for standalone mode
public HGInventoryService(InventoryServiceBase invService, IAssetService assetService, UserManagerBase userService, IHttpServer httpserver, string thisurl)
{
m_userService = userService;
m_assetProvider = assetService;
Init(invService, thisurl, httpserver);
}
开发者ID:ChrisD,项目名称:opensim,代码行数:8,代码来源:HGInventoryService.cs
示例5: HypergridServiceInConnector
public HypergridServiceInConnector(IConfigSource config, IHttpServer server, IHyperlinkService hyperService) :
base(config, server, String.Empty)
{
m_HyperlinkService = hyperService;
server.AddXmlRPCHandler("link_region", LinkRegionRequest, false);
server.AddXmlRPCHandler("expect_hg_user", ExpectHGUser, false);
}
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:7,代码来源:HypergridServerConnector.cs
示例6: GetTextureServerConnector
public GetTextureServerConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
if (configName != String.Empty)
m_ConfigName = configName;
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
string assetService = serverConfig.GetString("AssetService", String.Empty);
if (assetService == String.Empty)
throw new Exception("No AssetService in config file");
Object[] args = new Object[] { config };
m_AssetService =
ServerUtils.LoadPlugin<IAssetService>(assetService, args);
if (m_AssetService == null)
throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
string rurl = serverConfig.GetString("GetTextureRedirectURL");
;
server.AddStreamHandler(
new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService, "GetTexture", null, rurl));
}
开发者ID:RadaSangOn,项目名称:workCore2,代码行数:27,代码来源:GetTextureServerConnector.cs
示例7: Start
public void Start(IScene scene)
{
m_scene = scene;
m_scheduler = scene.Simian.GetAppModule<IScheduler>();
if (m_scheduler == null)
{
m_log.Warn("EventQueueManager requires an IScheduler");
return;
}
m_httpServer = m_scene.Simian.GetAppModule<IHttpServer>();
if (m_httpServer == null)
{
m_log.Warn("Upload requires an IHttpServer");
return;
}
m_scene.Capabilities.AddProtectedResource(m_scene.ID, "EventQueueGet", EventQueueHandler);
m_udp = m_scene.GetSceneModule<LLUDP>();
if (m_udp != null)
{
m_running = true;
m_scheduler.StartThread(EventQueueManagerThread, "EventQueue Manager (" + scene.Name + ")", ThreadPriority.Normal, false);
}
}
开发者ID:osgrid,项目名称:openmetaverse,代码行数:27,代码来源:EventQueueGet.cs
示例8: Start
public void Start(IScene scene)
{
m_scene = scene;
m_httpServer = m_scene.Simian.GetAppModule<IHttpServer>();
if (m_httpServer == null)
{
m_log.Warn("RezAvatar requires an IHttpServer");
return;
}
m_userClient = m_scene.Simian.GetAppModule<IUserClient>();
if (m_userClient == null)
{
m_log.Warn("RezAvatar requires an IUserClient");
return;
}
m_lludp = scene.GetSceneModule<LLUDP>();
if (m_lludp == null)
{
m_log.Error("Can't create the RegionDomain service without an LLUDP server");
return;
}
string urlFriendlySceneName = WebUtil.UrlEncode(m_scene.Name);
string regionPath = "/regions/" + urlFriendlySceneName;
m_httpServer.AddHandler("POST", null, regionPath + "/rez_avatar/request", true, true, RezAvatarRequestHandler);
m_scene.AddPublicCapability("rez_avatar/request", m_httpServer.HttpAddress.Combine(regionPath + "/rez_avatar/request"));
}
开发者ID:thoys,项目名称:simian,代码行数:31,代码来源:RezAvatar.cs
示例9: WifiServerConnector
public WifiServerConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
//
// Leaving this here for educational purposes
//
//if (Environment.StaticVariables.ContainsKey("AppDll"))
//{
// object[] args = new object[] { config, server };
// WebApp app = ServerUtils.LoadPlugin<IWebApp>(Environment.StaticVariables["AppDll"].ToString(), args);
// Environment.InitializeWebApp(app);
//}
// Launch the WebApp
WebApp app = new WebApp(config, m_ConfigName, server);
// Register all the handlers
server.AddStreamHandler(new WifiGetHandler(app));
server.AddStreamHandler(new WifiInstallGetHandler(app));
server.AddStreamHandler(new WifiInstallPostHandler(app));
server.AddStreamHandler(new WifiLoginHandler(app));
server.AddStreamHandler(new WifiLogoutHandler(app));
server.AddStreamHandler(new WifiUserAccountGetHandler(app));
server.AddStreamHandler(new WifiUserAccountPostHandler(app));
server.AddStreamHandler(new WifiUserManagementGetHandler(app));
server.AddStreamHandler(new WifiUserManagementPostHandler(app));
server.AddStreamHandler(new WifiRegionManagementPostHandler(app));
server.AddStreamHandler(new WifiRegionManagementGetHandler(app));
}
开发者ID:gumho,项目名称:diva-distribution,代码行数:33,代码来源:WifiServerConnector.cs
示例10: HGFriendsServerConnector
// Called from standalone configurations
public HGFriendsServerConnector(IConfigSource config, IHttpServer server, string configName, IFriendsSimConnector localConn)
: base(config, server, configName)
{
if (configName != string.Empty)
m_ConfigName = configName;
Object[] args = new Object[] { config, m_ConfigName, localConn };
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
string theService = serverConfig.GetString("LocalServiceModule",
String.Empty);
if (theService == String.Empty)
throw new Exception("No LocalServiceModule in config file");
m_TheService = ServerUtils.LoadPlugin<IHGFriendsService>(theService, args);
theService = serverConfig.GetString("UserAgentService", string.Empty);
if (theService == String.Empty)
throw new Exception("No UserAgentService in " + m_ConfigName);
m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(theService, new Object[] { config, localConn });
server.AddStreamHandler(new HGFriendsServerPostHandler(m_TheService, m_UserAgentService, localConn));
}
开发者ID:CassieEllen,项目名称:opensim,代码行数:26,代码来源:HGFriendServerConnector.cs
示例11: FetchInventory2ServerConnector
public FetchInventory2ServerConnector(IConfigSource config, IHttpServer server, string configName)
: base(config, server, configName)
{
if (configName != String.Empty)
m_ConfigName = configName;
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
string invService = serverConfig.GetString("InventoryService", String.Empty);
if (invService == String.Empty)
throw new Exception("No InventoryService in config file");
Object[] args = new Object[] { config };
m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args);
if (m_InventoryService == null)
throw new Exception(String.Format("Failed to load InventoryService from {0}; config is {1}", invService, m_ConfigName));
FetchInventory2Handler fiHandler = new FetchInventory2Handler(m_InventoryService);
IRequestHandler reqHandler
= new RestStreamHandler("POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest);
server.AddStreamHandler(reqHandler);
}
开发者ID:JAllard,项目名称:osmodified,代码行数:26,代码来源:FetchInventory2ServerConnector.cs
示例12: EventManager_OnRegisterCaps
private OSDMap EventManager_OnRegisterCaps(UUID agentID, IHttpServer server)
{
OSDMap retVal = new OSDMap();
retVal["EnvironmentSettings"] = CapsUtil.CreateCAPS("EnvironmentSettings", "");
#if (!ISWIN)
//Sets the windlight settings
server.AddStreamHandler(new RestHTTPHandler("POST", retVal["EnvironmentSettings"],
delegate(Hashtable m_dhttpMethod)
{
return SetEnvironment(m_dhttpMethod, agentID);
}));
//Sets the windlight settings
server.AddStreamHandler(new RestHTTPHandler("GET", retVal["EnvironmentSettings"],
delegate(Hashtable m_dhttpMethod)
{
return EnvironmentSettings(m_dhttpMethod, agentID);
}));
#else
//Sets the windlight settings
server.AddStreamHandler(new RestHTTPHandler("POST", retVal["EnvironmentSettings"],
m_dhttpMethod => SetEnvironment(m_dhttpMethod, agentID)));
//Sets the windlight settings
server.AddStreamHandler(new RestHTTPHandler("GET", retVal["EnvironmentSettings"],
m_dhttpMethod => EnvironmentSettings(m_dhttpMethod, agentID)));
#endif
return retVal;
}
开发者ID:Gnu32,项目名称:Silverfin,代码行数:27,代码来源:EnvironmentSettingsModule.cs
示例13: GetMeshServerConnector
public GetMeshServerConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
if (configName != String.Empty)
m_ConfigName = configName;
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
string assetService = serverConfig.GetString("AssetService", String.Empty);
if (assetService == String.Empty)
throw new Exception("No AssetService in config file");
Object[] args = new Object[] { config };
m_AssetService =
ServerUtils.LoadPlugin<IAssetService>(assetService, args);
if (m_AssetService == null)
throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
string rurl = serverConfig.GetString("GetMeshRedirectURL");
GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
IRequestHandler reqHandler
= new RestHTTPHandler(
"GET",
"/CAPS/" + UUID.Random(),
httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null),
"GetMesh",
null);
server.AddStreamHandler(reqHandler); ;
}
开发者ID:CassieEllen,项目名称:opensim,代码行数:34,代码来源:GetMeshServerConnector.cs
示例14: XInventoryInConnector
public XInventoryInConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
if (configName != String.Empty)
m_ConfigName = configName;
m_log.DebugFormat("[XInventoryInConnector]: Starting with config name {0}", m_ConfigName);
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
string inventoryService = serverConfig.GetString("LocalServiceModule",
String.Empty);
if (inventoryService == String.Empty)
throw new Exception("No InventoryService in config file");
Object[] args = new Object[] { config, m_ConfigName };
m_InventoryService =
ServerUtils.LoadPlugin<IInventoryService>(inventoryService, args);
IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
server.AddStreamHandler(new XInventoryConnectorPostHandler(m_InventoryService, auth));
}
开发者ID:emperorstarfinder,项目名称:Opensim2,代码行数:26,代码来源:XInventoryInConnector.cs
示例15: AssetServiceConnector
public AssetServiceConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
if (configName != String.Empty)
m_ConfigName = configName;
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
string assetService = serverConfig.GetString("LocalServiceModule",
String.Empty);
if (assetService == String.Empty)
throw new Exception("No AssetService in config file");
Object[] args = new Object[] { config };
m_AssetService =
ServerUtils.LoadPlugin<IAssetService>(assetService, args);
bool allowDelete = serverConfig.GetBoolean("AllowRemoteDelete", false);
server.AddStreamHandler(new AssetServerGetHandler(m_AssetService));
server.AddStreamHandler(new AssetServerPostHandler(m_AssetService));
server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, allowDelete));
}
开发者ID:AlexRa,项目名称:opensim-mods-Alex,代码行数:26,代码来源:AssetServerConnector.cs
示例16: WebFetchInvDescServerConnector
public WebFetchInvDescServerConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
if (configName != String.Empty)
m_ConfigName = configName;
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
string invService = serverConfig.GetString("InventoryService", String.Empty);
if (invService == String.Empty)
throw new Exception("No InventoryService in config file");
Object[] args = new Object[] { config };
m_InventoryService =
ServerUtils.LoadPlugin<IInventoryService>(invService, args);
if (m_InventoryService == null)
throw new Exception(String.Format("Failed to load InventoryService from {0}; config is {1}", invService, m_ConfigName));
string libService = serverConfig.GetString("LibraryService", String.Empty);
m_LibraryService =
ServerUtils.LoadPlugin<ILibraryService>(libService, args);
WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
IRequestHandler reqHandler = new RestStreamHandler("POST", "/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/, webFetchHandler.FetchInventoryDescendentsRequest);
server.AddStreamHandler(reqHandler);
}
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:30,代码来源:WebFetchInvDescServerConnector.cs
示例17: OpenIdServerConnector
public OpenIdServerConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
string authService = serverConfig.GetString("AuthenticationServiceModule",
String.Empty);
string userService = serverConfig.GetString("UserAccountServiceModule",
String.Empty);
if (authService == String.Empty || userService == String.Empty)
throw new Exception("No AuthenticationServiceModule or no UserAccountServiceModule in config file for OpenId authentication");
Object[] args = new Object[] { config };
m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args);
m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userService, args);
// Handler for OpenID user identity pages
server.AddStreamHandler(new OpenIdStreamHandler("GET", "/users/", m_UserAccountService, m_AuthenticationService));
// Handlers for the OpenID endpoint server
server.AddStreamHandler(new OpenIdStreamHandler("POST", "/openid/server/", m_UserAccountService, m_AuthenticationService));
server.AddStreamHandler(new OpenIdStreamHandler("GET", "/openid/server/", m_UserAccountService, m_AuthenticationService));
m_log.Info("[OPENID]: OpenId service enabled");
}
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:27,代码来源:OpenIdServerConnector.cs
示例18: UdpServerEntryPoint
/// <summary>
/// Initializes a new instance of the <see cref="UdpServerEntryPoint"/> class.
/// </summary>
/// <param name="logger">The logger.</param>
/// <param name="networkManager">The network manager.</param>
/// <param name="serverConfigurationManager">The server configuration manager.</param>
/// <param name="httpServer">The HTTP server.</param>
public UdpServerEntryPoint(ILogger logger, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager, IHttpServer httpServer)
{
_logger = logger;
_networkManager = networkManager;
_serverConfigurationManager = serverConfigurationManager;
_httpServer = httpServer;
}
开发者ID:RomanDengin,项目名称:MediaBrowser,代码行数:14,代码来源:UdpServerEntryPoint.cs
示例19: XBakesConnector
public XBakesConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
if (configName != String.Empty)
m_ConfigName = configName;
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
string assetService = serverConfig.GetString("LocalServiceModule",
String.Empty);
if (assetService == String.Empty)
throw new Exception("No BakedTextureService in config file");
Object[] args = new Object[] { config };
m_BakesService =
ServerUtils.LoadPlugin<IBakedTextureService>(assetService, args);
IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
server.AddStreamHandler(new BakesServerGetHandler(m_BakesService, auth));
server.AddStreamHandler(new BakesServerPostHandler(m_BakesService, auth));
}
开发者ID:CassieEllen,项目名称:opensim,代码行数:25,代码来源:XBakesHandler.cs
示例20: AssetServerConnector
public AssetServerConnector(IConfigSource config, IHttpServer server) :
base(config, server, "AssetService")
{
IConfig serverConfig = config.Configs["AssetService"];
if (serverConfig == null)
throw new Exception("No AssetService section in config file");
string assetService = serverConfig.GetString("LocalServiceModule", String.Empty);
if (String.IsNullOrEmpty(assetService))
throw new Exception("No LocalServiceModule in AssetService section in config file");
Object[] args = new Object[] { config };
m_AssetService = ServerUtils.LoadPlugin<IAssetService>(assetService, args);
if (m_AssetService == null)
throw new Exception("Failed to load IAssetService \"" + assetService + "\"");
// Asset service endpoints
server.AddStreamHandler(new TrustedStreamHandler("GET", "/assets", new CBAssetServerGetHandler(m_AssetService)));
server.AddStreamHandler(new TrustedStreamHandler("POST", "/assets", new CBAssetServerPostHandler(m_AssetService)));
server.AddStreamHandler(new TrustedStreamHandler("DELETE", "/assets", new CBAssetServerDeleteHandler(m_AssetService)));
// Register this server connector as a Cable Beach service
CableBeachServerState.RegisterService(new Uri(CableBeachServices.ASSETS), CreateCapabilitiesHandler);
CableBeachServerState.Log.Info("[CABLE BEACH ASSETS]: AssetServerConnector is running");
}
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:28,代码来源:AssetServerConnector.cs
注:本文中的IHttpServer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论