Skip to content

net: Dial does not try all resolved addresses #5267

@dsymonds

Description

@dsymonds
If a network name maps to multiple addresses (e.g. "localhost" often maps to
both "::1" and "127.0.0.1"), net.Dial does not try them all, but
only the first. This is a problem if a server is only listening on one of those
addresses.

Arguably the server is behaving incorrectly, but most networking libraries behave
reasonably here: they try them in sequence rather than just one.

I have a test case that demonstrates this in https://golang.org/cl/8644043.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions