mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-14 02:21:21 +00:00
swarm/: Allow disconnecting from Swarm and NetworkBehaviour (#2110)
Add `ExpandedSwarm::disconnect_peer_id` and `NetworkBehaviourAction::CloseConnection` to close connections to a specific peer via an `ExpandedSwarm` or `NetworkBehaviour`. Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
@ -3202,6 +3202,9 @@ where
|
||||
NetworkBehaviourAction::ReportObservedAddr { address, score } => {
|
||||
NetworkBehaviourAction::ReportObservedAddr { address, score }
|
||||
}
|
||||
NetworkBehaviourAction::CloseConnection { peer_id, connection } => {
|
||||
NetworkBehaviourAction::CloseConnection { peer_id, connection }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -657,7 +657,9 @@ where
|
||||
| NetworkBehaviourAction::NotifyHandler { peer_id, handler, event } =>
|
||||
NetworkBehaviourAction::NotifyHandler { peer_id, handler, event },
|
||||
| NetworkBehaviourAction::ReportObservedAddr { address, score } =>
|
||||
NetworkBehaviourAction::ReportObservedAddr { address, score }
|
||||
NetworkBehaviourAction::ReportObservedAddr { address, score },
|
||||
| NetworkBehaviourAction::CloseConnection { peer_id, connection } =>
|
||||
NetworkBehaviourAction::CloseConnection { peer_id, connection }
|
||||
};
|
||||
|
||||
return Poll::Ready(event)
|
||||
|
Reference in New Issue
Block a user