-
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
Obsolete Socket.UseOnlyOverlappedIO #52475
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @dotnet/ncl Issue Detailsclose #47163
|
using Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); | ||
|
||
Assert.False(s.UseOnlyOverlappedIO); | ||
s.UseOnlyOverlappedIO = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to keep some of the tests around, with the warning disabled around the use in tests.
We need to make sure that it still works as expected even once it is obsolete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can I add pragma warning disable
without diagnstic id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I can use CS0618
Okay, I'll return tests 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time for this! We need to include .NET 5+ in the obsoletion messages, otherwise looks good.
src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketInformationOptions.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketDuplicationTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Anton Firszov <antonfir@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
@@ -292,6 +292,8 @@ public partial class Socket : System.IDisposable | |||
[System.ObsoleteAttribute("SupportsIPv6 is obsoleted for this type, please use OSSupportsIPv6 instead. https://go.microsoft.com/fwlink/?linkid=14202")] | |||
public static bool SupportsIPv6 { get { throw null; } } | |||
public short Ttl { get { throw null; } set { } } | |||
[System.ObsoleteAttribute("This property has no effect in .NET 5+ and .NET Core.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@terrajobst, we really need a better way to refer to this :) For anything that started off in .NET Core, are we now going to have to say .NET Core and .NET 5+?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The official guide suggests to refer to it as
".NET" (without mention of 5 or Core)
which would be terribly confusing in this case. ("This property has no effect in .NET" 🤷)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be terribly confusing in this case
Right, but so is ".NET 5+ and .NET Core", as it incorrectly implies that .NET 5 isn't .NET Core.
cc: @richlander
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
".NET" (without mention of 5 or Core)
When you need to emphasize specific implementation (the case here), the guide suggests to use ".NET 5+ (and .NET Core)" for first reference and ".NET 5+" for subsequent references.
This guide was created just recently. I did not know about that. @antonfirsov thank you for sharing the link. There is a ton of places everywhere that use the phrase like the one used by this PR that was de-facto standard before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the guide suggests to use ".NET 5+ (and .NET Core)"
Actually, it suggests:
.NET 5 (and .NET Core) and later versions
which is terribly verbose (at a level that makes it obscure IMO), this is why I went with .NET 5+ and .NET Core
. I believe we should revisit that guide.
Right, but so is ".NET 5+ and .NET Core", as it incorrectly implies that .NET 5 isn't .NET Core.
@stephentoub although from internal (dotnet/runtime developer) perspective .NET 5 ⊂ .NET Core
(being just another release), from what I see from the guide, this is not what's being communicated on the branding front.
Maybe we should open a tracking issue, to revisit the terminology? If yes where?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.NET 5 (and .NET Core) and later versions
"and later versions" is the standardized docs terminology. Yes, it is verbose and it is often abbreviated. Perhaps the guide should mention the .NET 5+
abbreviation as an option. For example, this abbrevation is often used in https://github.com/dotnet/dotnet-api-docs currently.
Maybe we should open a tracking issue, to revisit the terminology? If yes where?
The docs repo. The document that describes the terminology is there.
close #47163