Skip to content

newly stabilized std::net::lookup_host not very ergonomic to use #23700

@nwin

Description

@nwin
Contributor

The new lookup_host method now returns SocketAddrs instead of an IpAddrs. Unfortunately the returned SocketAddr is not very useful because it defaults to port 0. Since SocketAddr does not have any setters for the port I basically have to re-create every single returned value to make use of it.

lookup_host should either take a port as an argument or only return IP addresses. I would prefer the latter.

Activity

alexcrichton

alexcrichton commented on Mar 25, 2015

@alexcrichton
Member

I agree that stabilizing it may have been a little hasty. I've proposed destabilizing it as part of #23711

steveklabnik

steveklabnik commented on Mar 26, 2015

@steveklabnik
Member

Since it was destabilized, I'm going to give this a close.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @steveklabnik@alexcrichton@nwin

        Issue actions

          newly stabilized std::net::lookup_host not very ergonomic to use · Issue #23700 · rust-lang/rust