dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.36k stars 4.75k forks source link

Socket.Shutdown() for UDP sockets: valid on Windows but leads to SocketException on Unix #47425

Open antonfirsov opened 3 years ago

antonfirsov commented 3 years ago

Follow up on https://github.com/dotnet/runtime/pull/47229#issuecomment-764829915 from #47229.

This is a behavioral difference between the OS-es, on Unix a call to shutdown(sockfd, how) returns ENOTCONN for UDP sockets. We may or may not want to address it in our code for compatibility.

ghost commented 3 years ago

Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.

Issue Details
Follow up on https://github.com/dotnet/runtime/pull/47229#issuecomment-764829915 from #47229. This is a behavioral difference between the OS-es, on Unix a call to `shutdown(sockfd, how)` returns `ENOTCONN` for UDP sockets. We may or may not want to address it in our code for compatibility.
Author: antonfirsov
Assignees: -
Labels: `area-System.Net.Sockets`, `untriaged`
Milestone: -
MichalPetryka commented 3 years ago

The issue title should probably be Socket.Shutdown() for UDP sockets: valid on Windows but leads to SocketException on Unix

ManickaP commented 3 years ago

Triage: discovered during our tests, not reported by a customer, pushing to future.