Skip to content

Specify behavior of functions taking ToSockAddrs #22569

Closed
@tbu-

Description

@tbu-
Contributor

Examples of such functions inclde UdpSocket::bind and UdpSocket::send. Is the first address taken, the last, are all addresses taken into consideration...

Activity

steveklabnik

steveklabnik commented on Mar 8, 2015

@steveklabnik
Member

I'm not 100% sure what this is asking, can you elaborate a bit, please?

alexcrichton

alexcrichton commented on Mar 8, 2015

@alexcrichton
Member

Functions that take T: ToSocketAddrs in the std::net module take an object which will be converted to any number of actual SocketAddr types. It's not currently clear what these methods do when there are multiple socket addresses that are resolved to.

For example, TcpStream::connect will attempt to connect to each address in turn (returning the first that succeeds), but UdpSocket::send will only send a datagram to the first address. Furthermore, there are questions like should TcpListener::bind bind to all the addresses or just one?

steveklabnik

steveklabnik commented on Mar 18, 2015

@steveklabnik
Member

Is the current behavior the correct one? IE, do we even want to make that guarantee?

tbu-

tbu- commented on Mar 19, 2015

@tbu-
ContributorAuthor

You could say what it does right now with a remark that it's not stabilized yet.

steveklabnik

steveklabnik commented on Apr 20, 2015

@steveklabnik
Member

I'm removing the 'docs' tag until we decide what we want to specify here.

tbu-

tbu- commented on Apr 20, 2015

@tbu-
ContributorAuthor

@steveklabnik Can you also remove the 'easy' tag?

removed
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
on Apr 8, 2016
Aatch

Aatch commented on Apr 8, 2016

@Aatch
Contributor

Is this still relevant? I don't think we change anything related in a backwards-compatible way.

alexcrichton

alexcrichton commented on Apr 8, 2016

@alexcrichton
Member

This is basically just a docs thing now, we need to be sure we specify what happens if multiple addresses are returned.

added
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
on Mar 10, 2017

34 remaining items

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

Metadata

Metadata

Assignees

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.P-highHigh priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @steveklabnik@alexcrichton@Aatch@frewsxcv@kmcallister

      Issue actions

        Specify behavior of functions taking `ToSockAddrs` · Issue #22569 · rust-lang/rust