コード例 #1
0
        /// <summary>
        /// Uses HTTP Protocol and accepts HTTP connections
        /// </summary>
        public static IHorseServer UseHttp(this IHorseServer server, HttpRequestHandler action, string optionsFilename)
        {
            HttpMethodHandler handler  = new HttpMethodHandler(action);
            HorseHttpProtocol protocol = new HorseHttpProtocol(server, handler, HttpOptions.Load(optionsFilename));

            server.UseProtocol(protocol);
            return(server);
        }
コード例 #2
0
        /// <summary>
        /// Uses HTTP Protocol and accepts HTTP connections
        /// </summary>
        public static IHorseServer UseHttp(this IHorseServer server, HttpRequestHandler action, HttpOptions options)
        {
            HttpMethodHandler handler  = new HttpMethodHandler(action);
            HorseHttpProtocol protocol = new HorseHttpProtocol(server, handler, options);

            server.UseProtocol(protocol);
            return(server);
        }