-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add Task-based async methods to Socket #17710
Comments
Stephen Toub already has done some work here. I'm leaving this note to inform visitors that a decent workaround is available. As far as I can tell his code for |
cc: @CIPop @stephentoub |
|
Cool, that's great news! I think this issue can be closed. Why were extension methods chosen as opposed to regular methods? This is a rare design choice. |
Nice! Closing.
It's so that Today, the implementations are the same in both cases. In the future, since for .Net Core they live next to the Socket code, they can eventually be optimized as true Task based APIs instead of wrappers over the Begin/End implementation. |
The Socket class is fully capable of async IO but
Task
-returning methods are missing. I find myself pulling in the same set of helper extensions each time I use async sockets.Since sockets are a primary use case for async IO I'd find this API addition extremely useful.
Note, that the async methods on
NetworkStream
are not enough because we need async support for things likeConnect
as well.The text was updated successfully, but these errors were encountered: