当前位置: 首页>>代码示例>>C#>>正文


C# IHttpServer类代码示例

本文整理汇总了C#中IHttpServer的典型用法代码示例。如果您正苦于以下问题:C# IHttpServer类的具体用法?C# IHttpServer怎么用?C# IHttpServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IHttpServer类属于命名空间,在下文中一共展示了IHttpServer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的IHttpServer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。