-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Move SocketTaskExtensions methods to Socket class itself #43901
Comments
Tagging subscribers to this area: @dotnet/ncl |
A question on file-organisation. Add these to Socket.cs or a new partial class file (as Socket.cs is already huge)? Or to Socket.Tasks.cs? |
In most cases this is probably just making the existing internal APIs in Socket.Tasks.cs public, as the stuff in SocketTaskExtensions.cs is already just calling directly into those methods. |
Looks good as proposed
|
Any reason to move the ArraySegment ones? |
Mostly just consistency. I don't think there's any harm in it, is there? |
On the contrary, I expect we'll find it's otherwise a breaking change. Imagine code like: ArraySegment<byte> segment = ...;
Task<int> t = socket.ReceiveAsync(segment, SocketFlags.None); With both the Someone can check me on that, but I'm pretty sure that's how things would play out. Yay complexities of overload resolution. |
Background and Motivation
For historical reasons, all of the Task-based APIs on Socket are defined as extension methods in SocketTaskExtensions.
We should move these methods to Socket itself, and mark the existing extension methods in SocketTaskExtensions as [EditorBrowsable(EditorBrowsableState.Never)].
Proposed API
Note this change should apply to the following planned 6.0 APIs as well, which have already been approved as new extension methods on SocketTaskExtensions.
#1608
#42591
#33418
The text was updated successfully, but these errors were encountered: