HttpServer.Server.SendResponse C# (CSharp) Method

SendResponse() protected method

Send a response.
protected SendResponse ( IHttpContext context, IRequest request, IResponse response ) : void
context IHttpContext
request IRequest
response IResponse
return void
        protected void SendResponse(IHttpContext context, IRequest request, IResponse response)
        {
            SendingResponse(this, new RequestEventArgs(context, request, response));

            var generator = HttpFactory.Current.Get<ResponseWriter>();
            generator.Send(context, response);
            if (request.Connection != null && request.Connection.Type == ConnectionType.Close)
            {
                context.Stream.Close();
                _logger.Debug("Closing connection.");
            }
        }