mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-23 00:00:10 +02:00
Docs: warn about errors from TcpListener::incoming (#247)
This commit is contained in:
committed by
Carl Lerche
parent
16d3540ce9
commit
5d87a9cee1
@@ -195,6 +195,16 @@ impl TcpListener {
|
||||
///
|
||||
/// This method returns an implementation of the `Stream` trait which
|
||||
/// resolves to the sockets the are accepted on this listener.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Note that accepting a connection can lead to various errors and not all of them are
|
||||
/// necessarily fatal ‒ for example having too many open file descriptors or the other side
|
||||
/// closing the connection while it waits in an accept queue. These would terminate the stream
|
||||
/// if not handled in any way.
|
||||
///
|
||||
/// If aiming for production, decision what to do about them must be made. The
|
||||
/// [`tk-listen`](https://crates.io/crates/tk-listen) crate might be of some help.
|
||||
pub fn incoming(self) -> Incoming {
|
||||
Incoming::new(self)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user