Skip to content

Commit

Permalink
Add UNRESPONSIVE close reason (#1491)
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart authored Oct 1, 2024
1 parent 89efcce commit d8762bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions commons/zenoh-protocol/src/transport/close.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub mod reason {
pub const MAX_SESSIONS: u8 = 0x03;
pub const MAX_LINKS: u8 = 0x04;
pub const EXPIRED: u8 = 0x05;
pub const UNRESPONSIVE: u8 = 0x06;
}

pub fn reason_to_str(reason: u8) -> &'static str {
Expand All @@ -75,6 +76,7 @@ pub fn reason_to_str(reason: u8) -> &'static str {
reason::MAX_SESSIONS => "MAX_SESSIONS",
reason::MAX_LINKS => "MAX_LINKS",
reason::EXPIRED => "EXPIRED",
reason::UNRESPONSIVE => "UNRESPONSIVE",
_ => "UNKNOWN",
}
}
Expand Down
2 changes: 1 addition & 1 deletion io/zenoh-transport/src/unicast/universal/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl TransportUnicastUniversal {
zenoh_runtime::ZRuntime::RX.spawn({
let transport = self.clone();
async move {
if let Err(e) = transport.close(close::reason::GENERIC).await {
if let Err(e) = transport.close(close::reason::UNRESPONSIVE).await {
tracing::error!(
"Error closing transport with {}: {}",
transport.config.zid,
Expand Down

0 comments on commit d8762bf

Please sign in to comment.