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


C# HttpServer.AddHandler方法代码示例

本文整理汇总了C#中HttpServer.AddHandler方法的典型用法代码示例。如果您正苦于以下问题:C# HttpServer.AddHandler方法的具体用法?C# HttpServer.AddHandler怎么用?C# HttpServer.AddHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HttpServer的用法示例。


在下文中一共展示了HttpServer.AddHandler方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EventQueueServer

 public EventQueueServer(HttpServer server, string path)
 {
     HttpRequestSignature signature = new HttpRequestSignature();
     signature.Method = "post";
     signature.ContentType = String.Empty;
     signature.Path = path;
     HttpServer.HttpRequestCallback callback = new HttpServer.HttpRequestCallback(EventQueueHandler);
     HttpServer.HttpRequestHandler handler = new HttpServer.HttpRequestHandler(signature, callback);
     server.AddHandler(handler);
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:10,代码来源:EventQueueServer.cs

示例2: InitHttpServer

        void InitHttpServer(int port, bool ssl)
        {
            HttpServer = new HttpServer(HttpPort, ssl);

            // Login webpage HEAD request, used to check if the login webpage is alive
            HttpServer.AddHandler("head", null, "^/loginpage", new HttpServer.HttpRequestCallback(LoginWebpageHeadHandler));

            // Login webpage GET request, gets the login webpage data (purely aesthetic)
            HttpServer.AddHandler("get", null, "^/loginpage", new HttpServer.HttpRequestCallback(LoginWebpageGetHandler));

            // Client XML-RPC login
            HttpServer.AddHandler("post", "text/xml", "^/login", new HttpServer.HttpRequestCallback(LoginXmlRpcPostHandler));

            // Client LLSD login
            HttpServer.AddHandler("post", "application/xml", "^/login", new HttpServer.HttpRequestCallback(LoginLLSDPostHandler));

            HttpServer.Start();
        }
开发者ID:jhs,项目名称:libopenmetaverse,代码行数:18,代码来源:Simian.cs

示例3: InitHttpServer

        void InitHttpServer(int port, bool ssl)
        {
            HttpServer = new HttpServer(tcpPort, ssl);

            // Login webpage HEAD request, used to check if the login webpage is alive
            HttpRequestSignature signature = new HttpRequestSignature();
            signature.Method = "head";
            signature.ContentType = String.Empty;
            signature.Path = "/loginpage";
            HttpServer.HttpRequestCallback callback = new HttpServer.HttpRequestCallback(LoginWebpageHeadHandler);
            HttpServer.HttpRequestHandler handler = new HttpServer.HttpRequestHandler(signature, callback);
            HttpServer.AddHandler(handler);

            // Login webpage GET request, gets the login webpage data (purely aesthetic)
            signature.Method = "get";
            signature.ContentType = String.Empty;
            signature.Path = "/loginpage";
            callback = new HttpServer.HttpRequestCallback(LoginWebpageGetHandler);
            handler.Signature = signature;
            handler.Callback = callback;
            HttpServer.AddHandler(handler);

            // Client XML-RPC login
            signature.Method = "post";
            signature.ContentType = "text/xml";
            signature.Path = "/login";
            callback = new HttpServer.HttpRequestCallback(LoginXmlRpcPostHandler);
            handler.Signature = signature;
            handler.Callback = callback;
            HttpServer.AddHandler(handler);

            // Client LLSD login
            signature.Method = "post";
            signature.ContentType = "application/xml";
            signature.Path = "/login";
            callback = new HttpServer.HttpRequestCallback(LoginLLSDPostHandler);
            handler.Signature = signature;
            handler.Callback = callback;
            HttpServer.AddHandler(handler);

            HttpServer.Start();
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:42,代码来源:Simian.cs


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