Skip to content

Conversation

antonfirsov
Copy link
Member

@antonfirsov antonfirsov commented Feb 8, 2025

There are behavioral inconsistencies between various Connect(Async) overloads on Unix when SetSocketOption. We harmonized them for .NET 10 in dotnet/runtime#111676.

However, on .NET 9 and earlier ConnectAsync(DnsEndPoint) will throw PlatformNotSupportedException on Unix when used together with SetSocketOption, therefore cross-platform code targetting the currently supported .NET versions should use ConnectAsync(IPEndPoint[], ...) instead.

Fixes #10866

@antonfirsov antonfirsov requested a review from a team as a code owner February 8, 2025 13:38
@ghost ghost added the area-System.Net label Feb 8, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl

@antonfirsov antonfirsov requested a review from a team February 8, 2025 13:47
Copy link

Learn Build status updates of commit 0d1dc88:

✅ Validation status: passed

File Status Preview URL Details
snippets/csharp/System.Net.Http/SocketsHttpHandler/ConnectCallback/program.cs ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

Copy link

Learn Build status updates of commit 56ad45b:

✅ Validation status: passed

File Status Preview URL Details
snippets/csharp/System.Net.Http/SocketsHttpHandler/ConnectCallback/program.cs ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@gewarren gewarren merged commit 42c8498 into dotnet:main Feb 10, 2025
4 checks passed
@HighPerfDotNet
Copy link

Please backport this fix to .NET 8 which is the current LTS, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Example for setting KeepAlive options in ConnectCallback on Linux

3 participants