-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,7 @@ public void Reset(ISocketConnection socketConnection) | |
lock (_lock) | ||
{ | ||
_socketConnection = socketConnection; | ||
_ctsReader = CancellationTokenSource.CreateLinkedTokenSource(_cts.Token); | ||
_ctsReader = new CancellationTokenSource(); | ||
|
||
_readerLoopTask = Task.Run(async () => | ||
{ | ||
|
@@ -85,7 +85,7 @@ public void Reset(ISocketConnection socketConnection) | |
} | ||
} | ||
|
||
public async Task FlushAsync() | ||
public async Task CancelReaderLoopAsync() | ||
{ | ||
CancellationTokenSource? cts; | ||
Task? readerTask; | ||
|
@@ -126,6 +126,16 @@ public async ValueTask DisposeAsync() | |
_channelLock.Writer.TryComplete(); | ||
_channelSize.Writer.TryComplete(); | ||
await _pipeWriter.CompleteAsync().ConfigureAwait(false); | ||
|
||
Task? readerTask; | ||
lock (_lock) | ||
{ | ||
readerTask = _readerLoopTask; | ||
} | ||
|
||
if (readerTask != null) | ||
await readerTask.ConfigureAwait(false); | ||
|
||
} | ||
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / test (main)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / test (main)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / test (v2.9.22)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / test (v2.9.22)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / test (v2.10.9)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / test (v2.10.9)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / check
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / check
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / memory test (main)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / memory test (main)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / memory test (main)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / memory test (main)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / memory test (v2.10.9)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / memory test (v2.10.9)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / memory test (v2.10.9)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / memory test (v2.10.9)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (v2.10.9)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (v2.10.9)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (v2.10.9)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (v2.10.9)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (v2.10.9)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (v2.10.9)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (main)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (main)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (main)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (main)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (main)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (main)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (v2.9.22)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (v2.9.22)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (v2.9.22)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (v2.9.22)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (v2.9.22)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / dotnet (v2.9.22)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / memory test (v2.9.22)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / memory test (v2.9.22)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / memory test (v2.9.22)
Check warning on line 139 in src/NATS.Client.Core/Commands/CommandWriter.cs GitHub Actions / memory test (v2.9.22)
|
||
|
||
public async ValueTask ConnectAsync(ClientOpts connectOpts, CancellationToken cancellationToken) | ||
|