1
0
mirror of https://github.com/oliverbooth/TcpDotNet synced 2024-11-09 23:25:42 +00:00

refactor: pass cancellation token to SetCanceled

This commit is contained in:
Oliver Booth 2024-02-13 00:33:04 +00:00
parent 19c83b14a1
commit 3ac93daf4f
Signed by: oliverbooth
GPG Key ID: E60B570D1B7557B5

View File

@ -295,11 +295,11 @@ public abstract class ClientNode : Node
}
catch (TaskCanceledException)
{
completionSource.SetCanceled();
completionSource.SetCanceled(cancellationToken);
}
}
completionSource.SetCanceled();
completionSource.SetCanceled(cancellationToken);
}, cancellationToken);
var packet = (TPacket)await Task.Run(() => completionSource.Task, cancellationToken);