public HttpClientHandlerBase Handle
 (
     IClient client,
     Func <IHttpContext, Task> requestHandler,
     IHttpRequestProvider requestProvider,
     ILogger logger
 )
 {
     return(_child.Handle(client, requestHandler, requestProvider, logger));
 }
예제 #2
0
파일: HttpServer.cs 프로젝트: Ultz/Spirit
        private async void Listen(IHttpListener listener)
        {
            var aggregatedHandler = _handlers.Aggregate();

            while (_isActive)
            {
                try
                {
                    _requestProvider.Handle
                    (
                        await listener.GetClient().ConfigureAwait(false), aggregatedHandler, _requestProvider,
                        LoggerProvider?.CreateLogger("ClientHandler")
                    );
                }
                catch (Exception e)
                {
                    Logger?.LogWarning("Error while getting client - " + e);
                }
            }

            Logger?.LogInformation("Spirit has stopped.");
        }