Skip to content

Commit 353a9bb

Browse files
authored
Merge pull request #23 from saorsa-labs/fix/event-driven-disconnect-detection
refactor!: replace health-check ping/pong with event-driven disconnect detection
2 parents b6bf2f9 + 48a28b2 commit 353a9bb

6 files changed

Lines changed: 82 additions & 218 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ members = [
66

77
[package]
88
name = "saorsa-transport"
9-
version = "0.27.0"
9+
version = "0.28.0"
1010
edition = "2024"
1111
rust-version = "1.88.0"
1212
license = "MIT OR Apache-2.0"

src/config/timeouts.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ pub mod discovery {
7474

7575
/// Long operation timeout
7676
pub const LONG_OPERATION_TIMEOUT: Duration = Duration::from_secs(10);
77-
78-
/// Health check interval
79-
pub const HEALTH_CHECK_INTERVAL: Duration = Duration::from_secs(30);
8077
}
8178

8279
/// Connection related timeouts
@@ -115,9 +112,6 @@ pub mod monitoring {
115112
/// Recovery timeout for failed operations
116113
pub const RECOVERY_TIMEOUT: Duration = Duration::from_secs(300);
117114

118-
/// Health check interval
119-
pub const HEALTH_CHECK_INTERVAL: Duration = Duration::from_secs(30);
120-
121115
/// Metrics retention period
122116
pub const RETENTION_PERIOD: Duration = Duration::from_secs(3600);
123117

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ pub use node_event::{DisconnectReason as NodeDisconnectReason, NodeEvent, Traver
347347

348348
/// P2P endpoint - for advanced use, prefer Node for most applications
349349
pub use p2p_endpoint::{
350-
ConnectionHealth, ConnectionMetrics, DisconnectReason, EndpointError, EndpointStats,
351-
P2pEndpoint, P2pEvent, PeerConnection, TraversalPhase,
350+
ConnectionMetrics, DisconnectReason, EndpointError, EndpointStats, P2pEndpoint, P2pEvent,
351+
PeerConnection, TraversalPhase,
352352
};
353353

354354
/// P2P configuration with builder pattern

src/node.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,6 @@ impl Node {
466466
self.inner.is_connected(addr).await
467467
}
468468

469-
/// Query the health status of a connection to a specific peer.
470-
///
471-
/// Returns `None` if the peer is not connected.
472-
pub async fn connection_health(&self, addr: &SocketAddr) -> Option<crate::ConnectionHealth> {
473-
self.inner.connection_health(addr).await
474-
}
475-
476469
// === Messaging ===
477470

478471
/// Send data to a peer by address

0 commit comments

Comments
 (0)