mirror of
https://github.com/oliverbooth/TcpDotNet
synced 2024-11-10 02:55:41 +00:00
refactor: pass cancellation token to SetCanceled
This commit is contained in:
parent
19c83b14a1
commit
3ac93daf4f
@ -295,11 +295,11 @@ public abstract class ClientNode : Node
|
|||||||
}
|
}
|
||||||
catch (TaskCanceledException)
|
catch (TaskCanceledException)
|
||||||
{
|
{
|
||||||
completionSource.SetCanceled();
|
completionSource.SetCanceled(cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
completionSource.SetCanceled();
|
completionSource.SetCanceled(cancellationToken);
|
||||||
}, cancellationToken);
|
}, cancellationToken);
|
||||||
|
|
||||||
var packet = (TPacket)await Task.Run(() => completionSource.Task, cancellationToken);
|
var packet = (TPacket)await Task.Run(() => completionSource.Task, cancellationToken);
|
||||||
|
Loading…
Reference in New Issue
Block a user