Skip to content

Clarify that send_to might fail in certain cases - #37432

Merged
bors merged 1 commit into
rust-lang:masterfrom
achanda:send_to
Nov 9, 2016
Merged

Clarify that send_to might fail in certain cases#37432
bors merged 1 commit into
rust-lang:masterfrom
achanda:send_to

Conversation

@achanda

Copy link
Copy Markdown
Contributor

@alexcrichton

Copy link
Copy Markdown
Member

Hm this doesn't panic, right? It'd return an error?

@CensoredUsername

Copy link
Copy Markdown
Contributor

This doesn't panic, it returns an error. In the linked issue unwrap() is just called on the error so it panics.

@achanda

Copy link
Copy Markdown
ContributorAuthor

My bad, updated now.

Comment threadsrc/libstd/net/udp.rs Outdated

Copy link
Copy Markdown
Member

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.

@brson

brson commented Nov 9, 2016

Copy link
Copy Markdown
Contributor

Waiting for updates to @alexcrichton's feedback.

@achanda

Copy link
Copy Markdown
ContributorAuthor

Sorry, this fell off my radar. Updated now.

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+

Thanks!

@bors

bors commented Nov 9, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 50bfc23 has been approved by alexcrichton

@sfacklersfackler changed the title Clarify that send_to might panic in certain casesClarify that send_to might fail in certain casesNov 9, 2016
eddyb added a commit to eddyb/rust that referenced this pull request Nov 9, 2016
@eddybeddyb mentioned this pull request Nov 9, 2016
bors added a commit that referenced this pull request Nov 9, 2016
@bors
bors merged commit 50bfc23 into rust-lang:masterNov 9, 2016
@achanda
achanda deleted the send_to branch November 10, 2016 11:51
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@achanda@alexcrichton@CensoredUsername@brson@bors