Пример #1
0
 public HttpKeepAliveService(IWatchDog watchDog, HttpSettings httpSettings)
 {
     Validation.RequireValidHttpSettings(httpSettings);
     _watchDog = watchDog
                 ?? throw new ArgumentNullException(nameof(watchDog));
     _httpSettings = httpSettings;
     _watchedConnections
         = new Dictionary <IDisposable, IWatchDogSession>();
 }
 public HttpChunkedResponseEncoder(
     Stream target,
     TcpSettings tcpSettings,
     HttpSettings httpSettings)
 {
     Validation.RequireValidTcpSettings(tcpSettings);
     Validation.RequireValidHttpSettings(httpSettings);
     _buffer       = new MemoryStream(httpSettings.MaxBodyChunkSize);
     _maxChunkSize = httpSettings.MaxBodyChunkSize;
     _target       = target ?? throw new ArgumentNullException(nameof(target));
     _tcpSettings  = tcpSettings;
 }
Пример #3
0
 internal HttpResponseBody(
     Stream rawResponseStream,
     TcpSettings tcpSettings,
     HttpSettings httpSettings,
     IHttpResponse response,
     ILogger logger)
 {
     Validation.RequireValidHttpSettings(httpSettings);
     Validation.RequireValidTcpSettings(tcpSettings);
     _tcpSettings = tcpSettings;
     _logger      = logger
                    ?? throw new ArgumentNullException(nameof(logger));
     _rawResponseStream = rawResponseStream
                          ?? throw new ArgumentNullException(nameof(rawResponseStream));
     _response = response
                 ?? throw new ArgumentNullException(nameof(response));
     _httpSettings    = httpSettings;
     _buffer          = new MemoryStream(httpSettings.MaxBodyChunkSize);
     _buffer.Position = 0;
 }
Пример #4
0
 public void SetHttpSettings(HttpSettings httpSettings)
 {
     Validation.RequireValidHttpSettings(httpSettings);
     _httpSettings = httpSettings;
 }