Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

use dual mode sockets in cases when address family is not set explicitly #30036

Merged
merged 2 commits into from
Jun 5, 2018

Conversation

wfurt
Copy link
Member

@wfurt wfurt commented Jun 1, 2018

fixes dotnet/runtime#26036 Classes inheriting TcpClient or Sockets don't function using correct IP by default.

in essence, this change allows to connect either to IPv4 or IPv6 when instantiated without specific address family. This is done by using dual mode socket if possible or falling back to IPv4 to match existing behavior.

Note that UDPClient has same problem. I can add it to this PR if we agree on approach or I can open new issue far that.

Aside from added unit test, I also tried to run sample test code from the issue.

@wfurt wfurt self-assigned this Jun 1, 2018
@wfurt wfurt requested a review from a team June 1, 2018 02:19
@davidsh davidsh requested a review from stephentoub June 1, 2018 02:37
@MattGal
Copy link
Member

MattGal commented Jun 1, 2018

@dotnet-bot help

@dotnet-bot
Copy link

Welcome to the dotnet/corefx Repository

The following is a list of valid commands on this PR. To invoke a command, comment the indicated phrase on the PR

The following commands are valid for all PRs and repositories.

Click to expand
Comment Phrase Action
@dotnet-bot test this please Re-run all legs. Use sparingly
@dotnet-bot test ci please Generates (but does not run) jobs based on changes to the groovy job definitions in this branch
@dotnet-bot help Print this help message

The following jobs are launched by default for each PR against dotnet/corefx:master.

Click to expand
Comment Phrase Job Launched
@dotnet-bot test Linux arm64 Release Build Linux arm64 Release Build
@dotnet-bot test Linux x64 Release Build Linux x64 Release Build
@dotnet-bot test Linux-musl x64 Debug Build Linux-musl x64 Debug Build
@dotnet-bot test OSX x64 Debug Build OSX x64 Debug Build
@dotnet-bot test Packaging All Configurations x64 Debug Build Packaging All Configurations x64 Debug Build
@dotnet-bot test Windows x64 Debug Build Windows x64 Debug Build
@dotnet-bot test Windows x86 Release Build Windows x86 Release Build
@dotnet-bot test NETFX x86 Release Build NETFX x86 Release Build
@dotnet-bot test UWP CoreCLR x64 Debug Build UWP CoreCLR x64 Debug Build
@dotnet-bot test UWP NETNative x86 Release Build UWP NETNative x86 Release Build

The following optional jobs are available in PRs against dotnet/corefx:master.

Click to expand
Comment Phrase Job Launched
@dotnet-bot test CentOS.6 x64 Debug Build Queues CentOS.6 x64 Debug Build
@dotnet-bot test Outerloop CentOS.6 x64 Debug Build Queues Outerloop CentOS.6 x64 Debug Build
@dotnet-bot test CentOS.6 x64 Release Build Queues CentOS.6 x64 Release Build
@dotnet-bot test Outerloop CentOS.6 x64 Release Build Queues Outerloop CentOS.6 x64 Release Build
@dotnet-bot test Linux arm64 Debug Build Queues Linux arm64 Debug Build
@dotnet-bot test Outerloop Linux arm64 Debug Build Queues Outerloop Linux arm64 Debug Build
@dotnet-bot test Linux x64 Debug Build Queues Linux x64 Debug Build
@dotnet-bot test Outerloop Linux x64 Debug Build Queues Outerloop Linux x64 Debug Build
@dotnet-bot test Outerloop Linux arm64 Release Build Queues Outerloop Linux arm64 Release Build
@dotnet-bot test Outerloop Linux x64 Release Build Queues Outerloop Linux x64 Release Build
@dotnet-bot test Outerloop Linux-musl x64 Debug Build Queues Outerloop Linux-musl x64 Debug Build
@dotnet-bot test Linux-musl x64 Release Build Queues Linux-musl x64 Release Build
@dotnet-bot test Outerloop Linux-musl x64 Release Build Queues Outerloop Linux-musl x64 Release Build
@dotnet-bot test Outerloop OSX x64 Debug Build Queues Outerloop OSX x64 Debug Build
@dotnet-bot test OSX x64 Release Build Queues OSX x64 Release Build
@dotnet-bot test Outerloop OSX x64 Release Build Queues Outerloop OSX x64 Release Build
@dotnet-bot test Outerloop Packaging All Configurations x64 Debug Build Queues Outerloop Packaging All Configurations x64 Debug Build
@dotnet-bot test Packaging All Configurations x86 Debug Build Queues Packaging All Configurations x86 Debug Build
@dotnet-bot test Outerloop Packaging All Configurations x86 Debug Build Queues Outerloop Packaging All Configurations x86 Debug Build
@dotnet-bot test Packaging All Configurations x64 Release Build Queues Packaging All Configurations x64 Release Build
@dotnet-bot test Outerloop Packaging All Configurations x64 Release Build Queues Outerloop Packaging All Configurations x64 Release Build
@dotnet-bot test Packaging All Configurations x86 Release Build Queues Packaging All Configurations x86 Release Build
@dotnet-bot test Outerloop Packaging All Configurations x86 Release Build Queues Outerloop Packaging All Configurations x86 Release Build
@dotnet-bot test Outerloop Windows x64 Debug Build Queues Outerloop Windows x64 Debug Build
@dotnet-bot test Windows x86 Debug Build Queues Windows x86 Debug Build
@dotnet-bot test Outerloop Windows x86 Debug Build Queues Outerloop Windows x86 Debug Build
@dotnet-bot test Windows x64 Release Build Queues Windows x64 Release Build
@dotnet-bot test Outerloop Windows x64 Release Build Queues Outerloop Windows x64 Release Build
@dotnet-bot test Outerloop Windows x86 Release Build Queues Outerloop Windows x86 Release Build
@dotnet-bot test NETFX x64 Debug Build Queues NETFX x64 Debug Build
@dotnet-bot test Outerloop NETFX x64 Debug Build Queues Outerloop NETFX x64 Debug Build
@dotnet-bot test NETFX x86 Debug Build Queues NETFX x86 Debug Build
@dotnet-bot test Outerloop NETFX x86 Debug Build Queues Outerloop NETFX x86 Debug Build
@dotnet-bot test NETFX x64 Release Build Queues NETFX x64 Release Build
@dotnet-bot test Outerloop NETFX x64 Release Build Queues Outerloop NETFX x64 Release Build
@dotnet-bot test Outerloop NETFX x86 Release Build Queues Outerloop NETFX x86 Release Build
@dotnet-bot test Outerloop UWP CoreCLR x64 Debug Build Queues Outerloop UWP CoreCLR x64 Debug Build
@dotnet-bot test UWP CoreCLR x86 Debug Build Queues UWP CoreCLR x86 Debug Build
@dotnet-bot test Outerloop UWP CoreCLR x86 Debug Build Queues Outerloop UWP CoreCLR x86 Debug Build
@dotnet-bot test UWP CoreCLR x64 Release Build Queues UWP CoreCLR x64 Release Build
@dotnet-bot test Outerloop UWP CoreCLR x64 Release Build Queues Outerloop UWP CoreCLR x64 Release Build
@dotnet-bot test UWP CoreCLR x86 Release Build Queues UWP CoreCLR x86 Release Build
@dotnet-bot test Outerloop UWP CoreCLR x86 Release Build Queues Outerloop UWP CoreCLR x86 Release Build
@dotnet-bot test UWP NETNative x64 Debug Build Queues UWP NETNative x64 Debug Build
@dotnet-bot test Outerloop UWP NETNative x64 Debug Build Queues Outerloop UWP NETNative x64 Debug Build
@dotnet-bot test UWP NETNative x86 Debug Build Queues UWP NETNative x86 Debug Build
@dotnet-bot test Outerloop UWP NETNative x86 Debug Build Queues Outerloop UWP NETNative x86 Debug Build
@dotnet-bot test UWP NETNative x64 Release Build Queues UWP NETNative x64 Release Build
@dotnet-bot test Outerloop UWP NETNative x64 Release Build Queues Outerloop UWP NETNative x64 Release Build
@dotnet-bot test Outerloop UWP NETNative x86 Release Build Queues Outerloop UWP NETNative x86 Release Build

Have a nice day!

@wfurt
Copy link
Member Author

wfurt commented Jun 1, 2018

seems like failures are infrastructure: null pointer java exception.

@wfurt
Copy link
Member Author

wfurt commented Jun 1, 2018

@dotnet-bot test Outerloop Windows x64 Debug Build
@dotnet-bot test Outerloop Linux x64 Debug Build
@dotnet-bot test Outerloop NETFX x86 Debug Build
@dotnet-bot test Outerloop OSX x64 Debug Build

@davidsh
Copy link
Contributor

davidsh commented Jun 1, 2018

Note that UDPClient has same problem. I can add it to this PR if we agree on approach or I can open new issue far that.

Changing UDPClient should be a separate issue/PR.

if we agree on approach

I think this is a good approach and unlikely to break existing customers using TcpClient().

@wfurt
Copy link
Member Author

wfurt commented Jun 1, 2018

most failures are caused by infrastructure. However new test is failing on NETFX/Windows 10.

@davidsh
Copy link
Contributor

davidsh commented Jun 1, 2018

However new test is failing on NETFX

This new test needs a SkipOnTargetFramework for NETFX since .NET Framework will still have the original behavior.

@wfurt
Copy link
Member Author

wfurt commented Jun 1, 2018

How about updating test to check what socket was created? In that case we could test both possibilities instead of disabling the test.

@davidsh
Copy link
Contributor

davidsh commented Jun 4, 2018

How about updating test to check what socket was created? In that case we could test both possibilities instead of disabling the test.

OK

…t case it will simply verify that TcpClient without explicit AF can be created without exception.
Copy link
Contributor

@rmkerr rmkerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@wfurt
Copy link
Member Author

wfurt commented Jun 4, 2018

Windows failures in System.Net.Security seems unrelated to this PR.

@wfurt
Copy link
Member Author

wfurt commented Jun 4, 2018

@dotnet-bot test Outerloop Windows x64 Debug Build
@dotnet-bot test Outerloop NETFX x86 Debug Build

@wfurt wfurt merged commit 4c86e8f into dotnet:master Jun 5, 2018
@wfurt wfurt deleted the fix_29414 branch June 5, 2018 03:33
@karelz karelz added this to the 3.0 milestone Jul 8, 2018
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…tly (dotnet/corefx#30036)

* use dual mode sockets in cases when address family is not set explicitly

* update test so it does not fail on platforms without DualMode. In that case it will simply verify that TcpClient without explicit AF can be created without exception.


Commit migrated from dotnet/corefx@4c86e8f
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Classes inheriting TcpClient or Sockets don't function using correct IP by default.
8 participants