diff --git a/TcpDotNet/ClientNode.cs b/TcpDotNet/ClientNode.cs index bc8ebd9..28ebda8 100644 --- a/TcpDotNet/ClientNode.cs +++ b/TcpDotNet/ClientNode.cs @@ -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);