This commit is contained in:
1 parent
02ef0095f5
commit
95bcc9bac4
12 files changed
+342
-63
No files matched your search
@@ -5,8 +5,8 @@ use std::sync::Arc;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use federation_net::{
|
||||
ByteStream, EndpointAddr, EndpointId, NetworkConfig, NetworkEngine, NetworkId, PeerTicket,
|
||||
SchemaId, SecretKey, Signature, StreamAcceptor,
|
||||
ByteStream, EndpointAddr, EndpointId, NetworkConfig, NetworkEngine, NetworkHealthSnapshot,
|
||||
NetworkId, PeerTicket, SchemaId, SecretKey, Signature, StreamAcceptor,
|
||||
};
|
||||
use tokio::sync::mpsc;
|
||||
use tokio::task::JoinHandle;
|
||||
@@ -375,6 +375,11 @@ impl MusicDhtService {
|
||||
self.node.engine.connected_peers()
|
||||
}
|
||||
|
||||
/// Returns a point-in-time snapshot of transport and rendezvous health.
|
||||
pub fn network_health(&self) -> NetworkHealthSnapshot {
|
||||
self.node.engine.health()
|
||||
}
|
||||
|
||||
/// Returns `true` if a transport connection to `peer` is open.
|
||||
pub fn is_connected(&self, peer: EndpointId) -> bool {
|
||||
self.node.engine.is_connected(peer)
|
||||
|
||||
Reference in new issue
Block a user