Exemplo n.º 1
0
        /// <summary>
        /// Uses HTTP Protocol and accepts HTTP connections
        /// </summary>
        public static ITwinoServer UseHttp(this ITwinoServer server, HttpRequestHandler action, string optionsFilename)
        {
            HttpMethodHandler handler  = new HttpMethodHandler(action);
            TwinoHttpProtocol protocol = new TwinoHttpProtocol(server, handler, HttpOptions.Load(optionsFilename));

            server.UseProtocol(protocol);
            return(server);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Uses HTTP Protocol and accepts HTTP connections
        /// </summary>
        public static ITwinoServer UseHttp(this ITwinoServer server, HttpRequestHandler action, HttpOptions options)
        {
            HttpMethodHandler handler  = new HttpMethodHandler(action);
            TwinoHttpProtocol protocol = new TwinoHttpProtocol(server, handler, options);

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