Exemplo n.º 1
0
        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);
        }
 /// <summary>
 /// Initialiazes configuration transport with a <see cref="SocketsTransport"/> with given settings.
 /// </summary>
 public static void SetupSocketTransport(this IClusterClientConfiguration self, SocketsTransportSettings settings)
 => self.Transport = new SocketsTransport(settings, self.Log);