Open geoffkizer opened 4 years ago
Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.
Is it common policy to not provide CancellationToken
support for synchronous APIs? It seems just as useful to have it for sync as it is for async.
@GSPP for sockets, it's not possible to implement reliable cancellation of synchronous calls in a cross-platform way. From https://github.com/dotnet/runtime/issues/42686#issuecomment-708937234:
Note that POSIX does not specify a way to abort on-going synchronous calls. The implementation is relying on OS specifics which work well on Linux, and less well on some other OSes. For best cross-platform behaviour applications should avoid using
Dispose
to abort on-going operations.
(#42686 is a typical issue around this problem)
In general we don't provide CancellationToken support for sync APIs.
Triage: The APIs should be approved in the spin offs, not in this issue - this one is just tracking all the work.
Note: Some of the sub-issues are simple, so good for up-for-grabs.
SendToAsync, ReceiveFromAsync, and ReceiveMessageFromAsync need Memory and CancellationToken support -- see #33148.
@geoffkizer you meant #938 I guess.
@geoffkizer you meant #938 I guess.
Actually, I meant #33418, but that links to #938 too. Thanks for catching, fixed now.
triage: we should revisit what is missing and close the mega issue
We still have a few gaps in our Socket APIs where we are missing support for Task, Span/Memory, or CancellationToken.
This is a mega-issue to track all remaining work here for 6.0.
Async Socket APIs:
Sync Socket APIs:
Async TcpListener APIs:
Async TcpClient APIs:
UdpClient APIs:
Related issues