コード例 #1
0
        public async Task ConnectionAvailable(ConnectionHandler handler)
        {
            currentConnection = handler;

            Log.Trace("Creating new http context");
            var http = new Http(currentConnection);

            Log.Trace("Start http processing");
            using (new Stopper(x => Log.Trace($"HTTP processing time: {x.ElapsedMilliseconds}ms")))
            {
                await http.Process();
            }
            Log.Trace("End http processing");
        }
コード例 #2
0
        public async Task HandleRequest(Http httpContext)
        {
            Log.Debug($"Resolving routing for {httpContext.Request.URL}");
            var routing = RouteHelper.Resolve(httpContext);
            if (routing == null)
            {
                Log.Error($"Routing not found for {httpContext.Request.URL}");
                await httpContext.Response.WriteFailHeader(HttpStatusCode.NotFound);
                return;
            }

            Log.Info($"Routing found for {httpContext.Request.URL}: {routing.Routing}");

            httpContext.Request.Routing = routing;

            await routing.Run(httpContext);
        }
コード例 #3
0
 public async Task HandleRequest(Http httpContext)
 {
     await httpContext.Response.WriteSuccessHeader();
 }