Skip to content

Commit

Permalink
Account for link creation in the open timeout (#1796)
Browse files Browse the repository at this point in the history
* Account for link creation in the open timeout

* Fix code

* Simplify code
  • Loading branch information
Mallets authored Feb 27, 2025
1 parent 1964079 commit 2311334
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions io/zenoh-transport/src/unicast/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,13 +734,13 @@ impl TransportManager {
)?;
};

// Create a new link associated by calling the Link Manager
let link = manager.new_link(endpoint.clone()).await?;
// Open the link
tokio::time::timeout(
self.config.unicast.open_timeout,
super::establishment::open::open_link(endpoint, link, self),
)
tokio::time::timeout(self.config.unicast.open_timeout, async {
match manager.new_link(endpoint.clone()).await {
Ok(link) => super::establishment::open::open_link(endpoint, link, self).await,
Err(e) => Err(e),
}
})
.await
.map_err(|e| zerror!("{e}"))?
}
Expand Down

0 comments on commit 2311334

Please sign in to comment.