Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify behavior of functions taking ToSockAddrs #22569

Closed
tbu- opened this issue Feb 20, 2015 · 10 comments
Closed

Specify behavior of functions taking ToSockAddrs #22569

tbu- opened this issue Feb 20, 2015 · 10 comments
Assignees
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. P-high High priority

Comments

@tbu-
Copy link
Contributor

tbu- commented Feb 20, 2015

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

@kmcallister kmcallister added A-docs E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Feb 21, 2015
@steveklabnik
Copy link
Member

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

@alexcrichton
Copy link
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
Copy link
Member

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

@tbu-
Copy link
Contributor Author

tbu- commented Mar 19, 2015

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

@steveklabnik
Copy link
Member

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

@tbu-
Copy link
Contributor Author

tbu- commented Apr 20, 2015

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

@Aatch Aatch removed the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Apr 8, 2016
@Aatch
Copy link
Contributor

Aatch commented Apr 8, 2016

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

@alexcrichton alexcrichton added A-docs and removed A-libs labels Apr 8, 2016
@alexcrichton
Copy link
Member

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

@steveklabnik steveklabnik added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Mar 10, 2017
@steveklabnik steveklabnik added the P-medium Medium priority label May 24, 2017
@steveklabnik steveklabnik added P-high High priority and removed P-medium Medium priority labels Jun 7, 2017
@steveklabnik steveklabnik self-assigned this Jun 7, 2017
@steveklabnik
Copy link
Member

Moving to p-high and assigning myself; i'd like to get this resolved in the next release cycle.

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 22, 2017
@frewsxcv frewsxcv assigned frewsxcv and unassigned steveklabnik Aug 23, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Aug 29, 2017
…xamples, r=QuietMisdreavus

Rewrite `std::net::ToSocketAddrs` doc examples.

in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios

done this as preliminary work while investigating rust-lang#22569

note: i haven't run doc tests on my machine for this, so would be good to confirm CI passes before approving
frewsxcv added a commit to frewsxcv/rust that referenced this issue Aug 29, 2017
…xamples, r=QuietMisdreavus

Rewrite `std::net::ToSocketAddrs` doc examples.

in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios

done this as preliminary work while investigating rust-lang#22569

note: i haven't run doc tests on my machine for this, so would be good to confirm CI passes before approving
frewsxcv added a commit to frewsxcv/rust that referenced this issue Aug 29, 2017
…xamples, r=QuietMisdreavus

Rewrite `std::net::ToSocketAddrs` doc examples.

in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios

done this as preliminary work while investigating rust-lang#22569

note: i haven't run doc tests on my machine for this, so would be good to confirm CI passes before approving
frewsxcv added a commit to frewsxcv/rust that referenced this issue Aug 29, 2017
…xamples, r=QuietMisdreavus

Rewrite `std::net::ToSocketAddrs` doc examples.

in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios

done this as preliminary work while investigating rust-lang#22569

note: i haven't run doc tests on my machine for this, so would be good to confirm CI passes before approving
arielb1 pushed a commit to arielb1/rust that referenced this issue Aug 29, 2017
…xamples, r=QuietMisdreavus

Rewrite `std::net::ToSocketAddrs` doc examples.

in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios

done this as preliminary work while investigating rust-lang#22569

note: i haven't run doc tests on my machine for this, so would be good to confirm CI passes before approving
arielb1 pushed a commit to arielb1/rust that referenced this issue Aug 29, 2017
…xamples, r=QuietMisdreavus

Rewrite `std::net::ToSocketAddrs` doc examples.

in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios

done this as preliminary work while investigating rust-lang#22569

note: i haven't run doc tests on my machine for this, so would be good to confirm CI passes before approving
@frewsxcv
Copy link
Member

Opened a PR for this: #44209

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Aug 31, 2017
…ios, r=alexcrichton

Expand docs of multi-address behavior of some UDP/TCP APIs.

Fixes rust-lang#22569.
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Sep 1, 2017
…ios, r=alexcrichton

Expand docs of multi-address behavior of some UDP/TCP APIs.

Fixes rust-lang#22569.
@bors bors closed this as completed in 0a716fd Sep 1, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Sep 11, 2017
…=frewsxcv

Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

CC @frewsxcv rust-lang#22569 rust-lang#44209
frewsxcv added a commit to frewsxcv/rust that referenced this issue Sep 11, 2017
…=frewsxcv

Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

CC @frewsxcv rust-lang#22569 rust-lang#44209
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Sep 13, 2017
…=frewsxcv

Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

CC @frewsxcv rust-lang#22569 rust-lang#44209
frewsxcv added a commit to frewsxcv/rust that referenced this issue Sep 14, 2017
…=frewsxcv

Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

CC @frewsxcv rust-lang#22569 rust-lang#44209
frewsxcv added a commit to frewsxcv/rust that referenced this issue Sep 15, 2017
…=frewsxcv

Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

CC @frewsxcv rust-lang#22569 rust-lang#44209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. P-high High priority
Projects
None yet
Development

No branches or pull requests

7 participants