Skip to content

Since 1.11.0 StreamSystem.Create fails with DnsEndpoint when targeting .NET 8 on Linux #463

Description

@bangjiehan

Describe the bug

Since 1.11.0 StreamSystem.Create fails with DnsEndpoint when targeting .NET 8 on Linux.

Linux does not allow reusing a failed socket, and DnsEndpoint seems to trigger a deterministic failure once at first.

The code below trigger this bug.

socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);

Reproduction steps

  1. .NET 8 application on Linux or WSL
  2. Using DnsEndpoint in Endpoints of StreamSystemConfig
  3. StreamSystem.Create fails

Expected behavior

Using either IPEndpoint or DnsEndpoint should work on both Windows and Linux.

Additional context

This is actually a known .NET runtime bug dotnet/runtime#110124 and fixed in .NET 10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions