@@ -256,8 +256,7 @@ await _channel0.ConnectionOpenAsync(_config.VirtualHost, cancellationToken)
256
256
{
257
257
var ea = new ShutdownEventArgs ( ShutdownInitiator . Library , Constants . InternalError , "FailedOpen" , cancellationToken : cancellationToken ) ;
258
258
await CloseAsync ( ea , true ,
259
- InternalConstants . DefaultConnectionAbortTimeout ,
260
- cancellationToken ) . ConfigureAwait ( false ) ;
259
+ InternalConstants . DefaultConnectionAbortTimeout ) . ConfigureAwait ( false ) ;
261
260
}
262
261
catch { }
263
262
@@ -300,7 +299,7 @@ public Task CloseAsync(ushort reasonCode, string reasonText, TimeSpan timeout, b
300
299
CancellationToken cancellationToken = default )
301
300
{
302
301
var reason = new ShutdownEventArgs ( ShutdownInitiator . Application , reasonCode , reasonText , cancellationToken : cancellationToken ) ;
303
- return CloseAsync ( reason , abort , timeout , cancellationToken ) ;
302
+ return CloseAsync ( reason , abort , timeout ) ;
304
303
}
305
304
306
305
///<summary>Asychronously try to close connection in a graceful way</summary>
@@ -318,8 +317,9 @@ public Task CloseAsync(ushort reasonCode, string reasonText, TimeSpan timeout, b
318
317
///to complete.
319
318
///</para>
320
319
///</remarks>
321
- internal async Task CloseAsync ( ShutdownEventArgs reason , bool abort , TimeSpan timeout , CancellationToken cancellationToken )
320
+ internal async Task CloseAsync ( ShutdownEventArgs reason , bool abort , TimeSpan timeout )
322
321
{
322
+ CancellationToken cancellationToken = reason . CancellationToken ;
323
323
CancellationToken argCancellationToken = cancellationToken ;
324
324
325
325
if ( abort && timeout < InternalConstants . DefaultConnectionAbortTimeout )
@@ -435,8 +435,9 @@ await _frameHandler.CloseAsync(cts.Token)
435
435
argCancellationToken . ThrowIfCancellationRequested ( ) ;
436
436
}
437
437
438
- internal async Task ClosedViaPeerAsync ( ShutdownEventArgs reason , CancellationToken cancellationToken )
438
+ internal async Task ClosedViaPeerAsync ( ShutdownEventArgs reason )
439
439
{
440
+ CancellationToken cancellationToken = reason . CancellationToken ;
440
441
if ( false == SetCloseReason ( reason ) )
441
442
{
442
443
if ( _closed )
0 commit comments