Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TcpHealthListener"/> class.
        /// </summary>
        /// <param name="healthListener">The registered <see cref="TcpHealthListener"/> instance.</param>
        /// <param name="options">The registered options to configure the <see cref="TcpHealthListener"/>.</param>
        /// <param name="logger">The logger to write diagnostic trace messages during accepting or rejecting TCP connections.</param>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="healthListener"/>, <paramref name="options"/>, or <paramref name="logger"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentException">Thrown when the <paramref name="options"/> doesn't have a filled-out value.</exception>
        public TcpHealthCheckPublisher(TcpHealthListener healthListener, TcpHealthListenerOptions options, ILogger <TcpHealthCheckPublisher> logger)
        {
            Guard.NotNull(healthListener, nameof(healthListener), "Requires a TCP health listener to accept or reject TCP connections");
            Guard.NotNull(options, nameof(options), "Requires a set of registered options to determine if the TCP connections should be accepted or rejected based on the health report");
            Guard.NotNull(logger, nameof(logger), "Requires a logger instance to write diagnostic trace messages when TCP connections are accepted or rejected");

            _healthListener = healthListener;
            _options        = options;
            _logger         = logger;
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TcpHealthListener"/> class.
 /// </summary>
 /// <param name="healthListener">The registered <see cref="TcpHealthListener"/> instance.</param>
 /// <param name="options">The registered options to configure the <see cref="TcpHealthListener"/>.</param>
 /// <exception cref="ArgumentNullException">Thrown when the <paramref name="healthListener"/>, or <paramref name="options"/> is <c>null</c>.</exception>
 /// <exception cref="ArgumentException">Thrown when the <paramref name="options"/> doesn't have a filled-out value.</exception>
 public TcpHealthCheckPublisher(TcpHealthListener healthListener, TcpHealthListenerOptions options)
     : this(healthListener, options, NullLogger <TcpHealthCheckPublisher> .Instance)
 {
 }