mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-24 23:31:33 +00:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user