mirror of https://github.com/rwf2/Rocket.git
Update comment in 'Listener' sleep code.
This commit is contained in:
parent
bf2bd0e9ed
commit
68185ce0e2
|
@ -143,11 +143,12 @@ impl<L: Listener> Incoming<L> {
|
||||||
cx: &mut Context<'_>
|
cx: &mut Context<'_>
|
||||||
) -> Poll<io::Result<L::Connection>> {
|
) -> Poll<io::Result<L::Connection>> {
|
||||||
/// This function defines per-connection errors: errors that affect only
|
/// This function defines per-connection errors: errors that affect only
|
||||||
/// a single connection. Since the error affects only one connection, we
|
/// a single connection's accept() and don't imply anything about the
|
||||||
/// can attempt to `accept()` another connection immediately. All other
|
/// success probability of the next accept(). Thus, we can attempt to
|
||||||
/// errors will incur a delay before the next `accept()` is performed.
|
/// `accept()` another connection immediately. All other errors will
|
||||||
/// The delay is useful to handle resource exhaustion errors like ENFILE
|
/// incur a delay before the next `accept()` is performed. The delay is
|
||||||
/// and EMFILE. Otherwise, could enter into tight loop.
|
/// useful to handle resource exhaustion errors like ENFILE and EMFILE.
|
||||||
|
/// Otherwise, could enter into tight loop.
|
||||||
fn is_connection_error(e: &io::Error) -> bool {
|
fn is_connection_error(e: &io::Error) -> bool {
|
||||||
matches!(e.kind(),
|
matches!(e.kind(),
|
||||||
| io::ErrorKind::ConnectionRefused
|
| io::ErrorKind::ConnectionRefused
|
||||||
|
|
Loading…
Reference in New Issue