Exemplo n.º 1
0
 public HttpConnection(IHttpApplication<TContext> application, IReadableChannel input, IWritableChannel output)
 {
     _application = application;
     _input = input;
     _output = output;
     _requestBody = new HttpRequestStream<TContext>(this);
     _responseBody = new HttpResponseStream<TContext>(this);
     _outputFormatter = _output.GetFormatter(EncodingData.InvariantUtf8);
 }
Exemplo n.º 2
0
        public void CopyTo(bool chunk, WritableChannelFormatter outputFormatter)
        {
            foreach (var header in _headers)
            {
                outputFormatter.Write(_headersStartBytes);
                outputFormatter.Append(header.Key);
                outputFormatter.Write(_headersSeperatorBytes);
                outputFormatter.Append(header.Value.ToString());
            }

            if (chunk)
            {
                outputFormatter.Write(_chunkedHeaderBytes);
            }

            outputFormatter.Write(_serverHeaderBytes);
            var date = _dateHeaderValueManager.GetDateHeaderValues().Bytes;

            outputFormatter.Write(date);

            outputFormatter.Write(_headersEndBytes);
        }
Exemplo n.º 3
0
 public void Initialize(IChannel channel)
 {
     _formatter = new WritableChannelFormatter(channel.Output, EncodingData.InvariantUtf8);
 }