Ejemplo n.º 1
0
            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 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;
        }
Ejemplo n.º 4
0
			public override Task HandleRequestAsync(FastcgiRequestAsync Request, FastcgiResponseAsync Response)
			{
				throw new NotImplementedException();
			}
Ejemplo n.º 5
0
 public abstract Task HandleRequestAsync(FastcgiRequestAsync Request, FastcgiResponseAsync Response);
Ejemplo n.º 6
0
		public abstract Task HandleRequestAsync(FastcgiRequestAsync Request, FastcgiResponseAsync Response);