Skip to content

Commit

Permalink
Merge pull request #108 from steveklabnik/gh69
Browse files Browse the repository at this point in the history
Document panics in listen
  • Loading branch information
steveklabnik authored Mar 20, 2018
2 parents 1106c51 + f74337f commit 10103f5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,21 @@ impl Server {
///
/// [best effort]: https://github.com/steveklabnik/simple-server/issues/54
///
/// # Panics
///
/// There are several circumstances in which `listen` can currently panic:
///
/// * If there's an error [constructing a TcpListener][constructing], generally if the port
/// or host is incorrect. See `TcpListener`'s docs for more.
/// * If the connection fails, see [`incoming`'s docs] for more.
///
/// Finally, if reading from the stream fails. Timeouts and connection closes
/// are handled, other errors may result in a panic. This will only take down
/// one of the threads in the threadpool, rather than the whole server.
///
/// [constructing]: https://doc.rust-lang.org/std/net/struct.TcpListener.html#method.bind
/// [`incoming`'s docs]: https://doc.rust-lang.org/std/net/struct.TcpListener.html#method.incoming
///
/// # Examples
///
/// ```no_run
Expand Down

0 comments on commit 10103f5

Please sign in to comment.