-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sockets: Reimplement remaining Task-based async methods using SocketAsyncEventArgs #41502
Comments
Tagging subscribers to this area: @dotnet/ncl |
When doing so, we need to review the exceptions thrown by different implementations, and either decide to harmonize (-> break and document) or to keep compatibility. See: #41585 (comment) |
@geoffkizer are you actually working on this? If not, I can give it a try. |
I have a PR in progress for SendTo/ReceiveFrom/ReceiveMessageFrom. I haven't had time to look at it recently. If you'd like to take what I've got and finish it up, you are welcome to. The other thing we should do here is to audit the code to see if there are any other methods besides this that are still using old IAsyncResult logic under the covers. I know the MultiConnect stuff was, but @stephentoub just fixed this. I think SendFile is another place -- see #42591. There may be others as well, I'm not entirely sure... |
Hasn't quite been merged yet, but will soon. |
Just looked: DisconnectAsync doesn't have a Task-based version either (like SendFile). We need to add this. |
The other thing we should be looking at here is getting rid of the old IAsyncResult implementations and replacing them with wrappers on top of Task APIs. We should be able to do this for the APIs that already have Task implementations, i.e. Connect/Accept/Send/Receive. I thought there was an issue on this but I can't find it at the moment. Will add if necessary. |
Yeah, unfortunately, that issue hasn't had API review. I will probably file a separate issue for DisconnectAsync specifically so we can get it through API review quickly. |
Ok, maybe just reopen the original issue #1608. |
Done |
I think we should fix #1712 (harden and re-enable test |
Most socket Task-based async APIs are implemented using SocketAsyncEventArgs under the covers today.
The few that are not include:
SendToAsync
ReceiveFromAsync
ReceiveMessageFromAsync
These are instead implemented by wrapping the old IAsyncResult-based async methods.
We should change these to use SocketAsyncEventArgs instead.
The text was updated successfully, but these errors were encountered: