-
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
Socket: don't assign right endpoint until the connect is successful. #53581
Conversation
'Right endpoint' must match the address family of the Socket or we can't serialize the LocalEndPoint and RemoteEndPoint. When multiple connect attempts are made against a DualMode Socket with both IPv4 and IPv6 addresses, a failed attempt must not set 'right endpoint'.
Tagging subscribers to this area: @dotnet/ncl Issue Details'Right endpoint' must match the address family of the Socket or When multiple connect attempts are made against a DualMode Socket with Fixes #53447. cc @wfurt @geoffkizer @antonfirsov @stephentoub @pepone
|
There is a test failure here: runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketTaskExtensionsTest.cs Line 38 in f4e01f5
The |
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/Socket.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketTaskExtensionsTest.cs
Outdated
Show resolved
Hide resolved
@geoffkizer thanks for the review! I've addressed your feedback. |
Windows behaves different from Linux. Something still assigns 'right endpoint' on Windows. @antonfirsov can you help me figure out what it is? If you step through the
|
@tmds this is happenning because of runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Windows.cs Lines 210 to 238 in 0fcd769
Since we are actually binding the socket in this case, I think this is a platform difference we need to accept. We may open an issue for harmonization if that makes sense. The test can be "fixed" by simply moving the UDP calls before the connect calls. |
…o avoid wildcard bind on Windows that leads to a different exception
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
Changes look good to me. Let's run outerloop before merging. |
Failures look unrelated. |
'Right endpoint' must match the address family of the Socket or
we can't serialize the LocalEndPoint and RemoteEndPoint.
When multiple connect attempts are made against a DualMode Socket with
both IPv4 and IPv6 addresses, a failed attempt must not set 'right
endpoint'.
Fixes #53447.
cc @wfurt @geoffkizer @antonfirsov @stephentoub @pepone