mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-12 04:37:23 +08:00
make sure event is triggered when peer conn remove (#1507)
This commit is contained in:
@@ -226,6 +226,11 @@ impl Peer {
|
||||
// pritn on drop
|
||||
impl Drop for Peer {
|
||||
fn drop(&mut self) {
|
||||
self.conns.retain(|_, conn| {
|
||||
self.global_ctx
|
||||
.issue_event(GlobalCtxEvent::PeerConnRemoved(conn.get_conn_info()));
|
||||
false
|
||||
});
|
||||
self.shutdown_notifier.notify_one();
|
||||
tracing::info!("peer {} drop", self.peer_node_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user