added example
This commit is contained in:
1 parent
057436adb6
commit
a97f0a04b3
21 files changed
+4456
-4
No files matched your search
@@ -684,6 +684,11 @@ impl<M: Message> NetworkEngine<M> {
|
||||
lock(&self.shared.peers).keys().copied().collect()
|
||||
}
|
||||
|
||||
/// Returns `true` if there is an active connection to `peer`.
|
||||
pub fn is_connected(&self, peer: EndpointId) -> bool {
|
||||
lock(&self.shared.peers).contains_key(&peer)
|
||||
}
|
||||
|
||||
/// Closes the connection to `peer` and removes it from the registry.
|
||||
pub async fn disconnect(&self, peer: EndpointId) -> Result<()> {
|
||||
let state = lock(&self.shared.peers)
|
||||
|
||||
Reference in new issue
Block a user