diff --git a/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs b/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs index 0cde5b0dcc..98524d6d9a 100644 --- a/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs +++ b/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs @@ -1944,7 +1944,7 @@ namespace Microsoft.AspNetCore.SignalR.Client public async Task WaitForActiveConnectionAsync(string methodName, [CallerMemberName] string memberName = null, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = 0) { - await WaitConnectionLockAsync(); + await WaitConnectionLockAsync(methodName); if (CurrentConnectionStateUnsynchronized == null || CurrentConnectionStateUnsynchronized.Stopping) { diff --git a/src/SignalR/common/Shared/AsyncEnumerableAdapters.cs b/src/SignalR/common/Shared/AsyncEnumerableAdapters.cs index d997233e43..e1d722bcea 100644 --- a/src/SignalR/common/Shared/AsyncEnumerableAdapters.cs +++ b/src/SignalR/common/Shared/AsyncEnumerableAdapters.cs @@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.SignalR.Internal public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - var enumerator = _asyncEnumerable.GetAsyncEnumerator(); + var enumerator = _asyncEnumerable.GetAsyncEnumerator(_cts.Token); if (cancellationToken.CanBeCanceled) { var registration = cancellationToken.Register((ctsState) => @@ -53,7 +53,7 @@ namespace Microsoft.AspNetCore.SignalR.Internal ((CancellationTokenSource)ctsState).Cancel(); }, _cts); - return new CancelableEnumerator(_asyncEnumerable.GetAsyncEnumerator(), registration); + return new CancelableEnumerator(enumerator, registration); } return enumerator;