-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Clarify that send_to might fail in certain cases #37432
Conversation
Hm this doesn't panic, right? It'd return an error? |
This doesn't panic, it returns an error. In the linked issue |
My bad, updated now. |
@@ -67,6 +67,9 @@ impl UdpSocket { | |||
/// | |||
/// Address type can be any implementor of `ToSocketAddrs` trait. See its | |||
/// documentation for concrete examples. | |||
/// This might return an error when using local addresses using the string | |||
/// "localhost". See https://github.com/rust-lang/rust/issues/34202 for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we may want to generalize this error to more than just this issue. It may be worth just mentioning that the returned addresses from ToSocketAddrs
must match the IPv4 or IPv6-ness of the address the UDP socket is bound to. This problem isn't only related to localhost I believe.
Waiting for updates to @alexcrichton's feedback. |
Sorry, this fell off my radar. Updated now. |
@bors: r+ Thanks! |
📌 Commit 50bfc23 has been approved by |
Clarify that send_to might panic in certain cases Closes rust-lang#34202 r? @alexcrichton
Closes #34202
r? @alexcrichton