Automatically close useless connections (#816)

* Automatically close useless connections

* Add a timeout before dropping the connection

* Rework the timeout

* Use OR to combine the outcome
This commit is contained in:
Pierre Krieger
2019-01-04 12:02:39 +01:00
committed by GitHub
parent ea0f61366c
commit 7da1a860be
12 changed files with 123 additions and 8 deletions

View File

@ -489,6 +489,11 @@ where
}
}
#[inline]
fn connection_keep_alive(&self) -> bool {
!self.substreams.is_empty()
}
#[inline]
fn shutdown(&mut self) {
self.shutting_down = true;