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

TcpListener docs example contains an explicit drop that can never be reached #35950

Closed
sfackler opened this issue Aug 23, 2016 · 2 comments
Closed
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools

Comments

@sfackler
Copy link
Member

The incoming iterator never returns None, so the drop at the end will never be reached. The explicit matching against the socket result also seems potentially nonconventional docs-wise?

https://doc.rust-lang.org/std/net/struct.TcpListener.html#examples

@abonander
Copy link
Contributor

Also, what are the semantics of this iterator when the listener is set to nonblocking mode? If it's equivalent to accept() it should run the loop with WouldBlock errors until a connection is made.

@sfackler
Copy link
Member Author

That's what it'd do, yeah. The next method is super simple: https://doc.rust-lang.org/src/std/up/src/libstd/sys/unix/ext/net.rs.html#532

@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 added a commit to steveklabnik/rust that referenced this issue Apr 25, 2017
arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 25, 2017
arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 25, 2017
steveklabnik added a commit to steveklabnik/rust that referenced this issue Apr 26, 2017
arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 27, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 27, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 27, 2017
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
Projects
None yet
Development

No branches or pull requests

3 participants