Пример #1
0
        public SocketTuningContent(GenericContent content, SocketTuner tuner, ILog log)
        {
            this.content = content;
            this.tuner   = tuner;
            this.log     = log;

            CopyHeaders();
        }
Пример #2
0
        /// <inheritdoc cref="SocketsHttpHandler" />
        public SocketsTransport([NotNull] SocketsTransportSettings settings, [NotNull] ILog log)
        {
            this.settings = settings ?? throw new ArgumentNullException(nameof(settings));
            this.log      = log ?? throw new ArgumentNullException(nameof(log));

            handlerProvider = new SocketsHandlerProvider(settings);
            timeoutProvider = new TimeoutProvider(settings.RequestAbortTimeout, this.log);
            errorHandler    = new ErrorHandler(this.log);
            socketTuner     = new SocketTuner(settings, this.log);
            bodyReader      = new BodyReader(
                settings.BufferFactory,
                len => settings.UseResponseStreaming(len),
                () => settings.MaxResponseBodySize,
                this.log);
        }