private void GracefulShutdownTimeoutWhenConnectionErrorTest0(ShutdownHint hint)
        {
            _handler = NewHandler();
            long expectedMillis = 1234;

            _handler.GracefulShutdownTimeout = TimeSpan.FromMilliseconds(expectedMillis);
            Http2Exception exception = new Http2Exception(Http2Error.ProtocolError, "Test error", hint);

            _handler.OnConnectionError(_ctx.Object, false, exception, exception);
            if (hint == ShutdownHint.GracefulShutdown)
            {
                _executor.Verify(
                    x => x.Schedule(
                        It.IsAny <Action <object> >(),
                        It.IsAny <object>(),
                        It.Is <TimeSpan>(v => v == TimeSpan.FromMilliseconds(expectedMillis))),
                    Times.AtLeastOnce());
            }
            else
            {
                _executor.Verify(
                    x => x.Schedule(
                        It.IsAny <Action <object, object> >(),
                        It.IsAny <object>(),
                        It.IsAny <object>(),
                        It.Is <TimeSpan>(v => v == TimeSpan.FromMilliseconds(expectedMillis))),
                    Times.AtLeastOnce());
            }
        }
Example #2
0
 public Http2Exception(Http2Error error, string message, Exception cause, ShutdownHint shutdownHint)
     : base(message, cause)
 {
     Error        = error;
     ShutdownHint = shutdownHint;
 }
Example #3
0
 public Http2Exception(Http2Error error, ShutdownHint shutdownHint)
 {
     Error        = error;
     ShutdownHint = shutdownHint;
 }