private void GenerateResponse(FastCGIRequestAsync request,FastCGIResponseAsync response)
        {
            var handler = handlers[request.Params["SCRIPT_FILENAME"]];

            FastCGIRequest requestArg = new FastCGIRequest(request);

            var responseResult = handler(requestArg);

            response.StdOutWriter.WriteLine("Hi!");
        }
 private void HandleRequest(FastCGIRequestAsync request, FastCGIResponseAsync response)
 {
     if (!handlers.ContainsKey(request.Params["SCRIPT_FILENAME"]))
     {
         GenerateNotFoundResponse(response);
     }
     else
     {
         GenerateResponse(request, response);
     }
 }
        public FastCGIServerClientRequestHandlerAsync(FastCGIServerClientHandlerAsync FastcgiServerClientHandlerAsync, Stream ClientStream, ushort RequestId)
        {
            this.FastcgiServerClientHandlerAsync = FastcgiServerClientHandlerAsync;
            this.ClientStream        = ClientStream;
            this.RequestId           = RequestId;
            this.FastcgiRequestAsync = new FastCGIRequestAsync()
            {
                StdInStream = new FastCGIInputStream(),
            };
            this.FastcgiResponseAsync = new FastCGIResponseAsync()
            {
                StdOutStream = new FastCGIOutputStream(),
                StdErrStream = new FastCGIOutputStream(),
                Headers      = new FastCGIHeaders(),
            };

            this.FastcgiResponseAsync.StdOutWriter           = new StreamWriter(this.FastcgiResponseAsync.StdOutStream);
            this.FastcgiResponseAsync.StdOutWriter.AutoFlush = true;

            this.FastcgiResponseAsync.StdErrWriter           = new StreamWriter(this.FastcgiResponseAsync.StdErrStream);
            this.FastcgiResponseAsync.StdErrWriter.AutoFlush = true;
        }
        public FastCGIServerClientRequestHandlerAsync(FastCGIServerClientHandlerAsync FastcgiServerClientHandlerAsync, Stream ClientStream, ushort RequestId)
		{
			this.FastcgiServerClientHandlerAsync = FastcgiServerClientHandlerAsync;
			this.ClientStream = ClientStream;
			this.RequestId = RequestId;
			this.FastcgiRequestAsync = new FastCGIRequestAsync()
			{
				StdInStream = new FastCGIInputStream(),
			};
			this.FastcgiResponseAsync = new FastCGIResponseAsync()
			{
				StdOutStream = new FastCGIOutputStream(),
                StdErrStream = new FastCGIOutputStream(),
				Headers = new FastCGIHeaders(),
			};

			this.FastcgiResponseAsync.StdOutWriter = new StreamWriter(this.FastcgiResponseAsync.StdOutStream);
			this.FastcgiResponseAsync.StdOutWriter.AutoFlush = true;

			this.FastcgiResponseAsync.StdErrWriter = new StreamWriter(this.FastcgiResponseAsync.StdErrStream);
			this.FastcgiResponseAsync.StdErrWriter.AutoFlush = true;
		}
        public override Task HandleRequestAsync(FastCGIRequestAsync request, FastCGIResponseAsync response)
        {
            Action<FastCGIRequestAsync,FastCGIResponseAsync> action = this.HandleRequest;

            return Task.Factory.FromAsync(action.BeginInvoke, action.EndInvoke, request, response, null);
        }
 internal FastCGIRequest(FastCGIRequestAsync request)
 {
     QueryStringParams = HttpUtility.ParseQueryString(request.Params["QUERY_STRING"]);
 }
Exemple #7
0
 public abstract Task HandleRequestAsync(FastCGIRequestAsync Request, FastCGIResponseAsync Response);