public override async Task HandleRequestAsync(FastcgiRequestAsync Request, FastcgiResponseAsync Response) { var StreamWriter = new StreamWriter(Response.StdoutStream); StreamWriter.AutoFlush = true; //StreamWriter.Write("Hello World!"); var Stopwatch = new Stopwatch(); Stopwatch.Start(); var Html = TemplateFactory.GetTemplateCodeByFile("Test.html").RenderToString(); Stopwatch.Stop(); StreamWriter.Write("Content-type: text/html\r\n"); StreamWriter.Write("X-Time: {0}\r\n", Stopwatch.Elapsed); StreamWriter.Write("\r\n"); StreamWriter.Write(Html); StreamWriter.Write(Request.Params.ToJson()); //throw (new Exception("Error!")); }
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) { throw new NotImplementedException(); }
public abstract Task HandleRequestAsync(FastcgiRequestAsync Request, FastcgiResponseAsync Response);