-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Socket.Select throws ObjectDisposedException when one of the sockets is disposed #34886
Comments
Tagging @dotnet/ncl as an area owner. If you would like to be tagged for a label, please notify danmosemsft. |
This is caused by dotnet/corefx#41763. With the old behavior, no reference counting was performed. The With the change, |
So it is technical breaking change in 5.0. @drieseng how did you discover the difference? Did you run into it in your app? |
It's fine to document it. It's a bug that should have been fixed years ago when things were moved to be SafeHandle-based. It's a handle-recycling issue. |
OK, marking as such. cc @antonfirsov |
I'm really impressed by the speed at which this decision was taken and verified across all implementations (.NET, Mono, ...). Because this is how such a thing is done, right ? Note that I'm ok with this decision, but I would expect there to be more discussion on such changes (even if you can consider it an implementation detail). In the desktop framework, there was a very high level of compatibility and a slower pace of innovation. I definitely welcome the high pace of innovation that we have right now, but I get the impression that compatibility is sometimes abandoned all too fast. This specific issue is perhaps not the best example of this, but it does show easy "breaking" changes are introduced. |
It is certainly nice that the test is running on Mono automatically. It shows the value of all being in one repo. |
That's indeed true. |
Fixed by PR dotnet/dotnet-api-docs#4720 |
In (desktop) .NET Framework,
Socket.Select(....)
throws a SocketException when one of the sockets that you specify is disposed:In .NET Core 2.1 and 3.1, this is also the exception that is thrown on Windows. On Linux, no exception is thrown.
Now in .NET 5.0 Preview 2, an ObjectDisposedException is thrown on both Windows and Linux:
To reproduce, compile and run the following code fragment:
The text was updated successfully, but these errors were encountered: