Skip to content

Commit

Permalink
Merge pull request #1623 from eclipse-zenoh/dev/default_endpoints
Browse files Browse the repository at this point in the history
Change default config listen endpoints when transport_tcp feature is disabled
  • Loading branch information
Mallets authored Dec 3, 2024
2 parents c6f52c2 + 860498c commit 9a73585
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions commons/zenoh-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ description = "Internal crate for zenoh."

[features]
internal = []
transport_tcp = []

[dependencies]
tracing = { workspace = true }
Expand Down
6 changes: 6 additions & 0 deletions commons/zenoh-config/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,14 @@ impl Default for ListenConfig {
Self {
timeout_ms: None,
endpoints: ModeDependentValue::Dependent(ModeValues {
#[cfg(feature = "transport_tcp")]
router: Some(vec!["tcp/[::]:7447".parse().unwrap()]),
#[cfg(not(feature = "transport_tcp"))]
router: Some(vec![]),
#[cfg(feature = "transport_tcp")]
peer: Some(vec!["tcp/[::]:0".parse().unwrap()]),
#[cfg(not(feature = "transport_tcp"))]
peer: Some(vec![]),
client: None,
}),
exit_on_failure: None,
Expand Down
2 changes: 1 addition & 1 deletion io/zenoh-link/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ description = "Internal crate for zenoh."

[features]
transport_quic = ["zenoh-link-quic"]
transport_tcp = ["zenoh-link-tcp"]
transport_tcp = ["zenoh-link-tcp", "zenoh-config/transport_tcp"]
transport_tls = ["zenoh-link-tls"]
transport_udp = ["zenoh-link-udp"]
transport_unixsock-stream = ["zenoh-link-unixsock_stream"]
Expand Down
2 changes: 1 addition & 1 deletion io/zenoh-transport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ auth_usrpwd = ["transport_auth"]
transport_auth = []
transport_multilink = ["auth_pubkey"]
transport_quic = ["zenoh-link/transport_quic"]
transport_tcp = ["zenoh-link/transport_tcp"]
transport_tcp = ["zenoh-link/transport_tcp", "zenoh-config/transport_tcp"]
transport_tls = ["zenoh-link/transport_tls"]
transport_udp = ["zenoh-link/transport_udp"]
transport_unixsock-stream = ["zenoh-link/transport_unixsock-stream"]
Expand Down
2 changes: 1 addition & 1 deletion zenoh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ transport_compression = ["zenoh-transport/transport_compression"]
transport_quic = ["zenoh-transport/transport_quic"]
transport_serial = ["zenoh-transport/transport_serial"]
transport_unixpipe = ["zenoh-transport/transport_unixpipe"]
transport_tcp = ["zenoh-transport/transport_tcp"]
transport_tcp = ["zenoh-transport/transport_tcp", "zenoh-config/transport_tcp"]
transport_tls = ["zenoh-transport/transport_tls"]
transport_udp = ["zenoh-transport/transport_udp"]
transport_unixsock-stream = ["zenoh-transport/transport_unixsock-stream"]
Expand Down
4 changes: 4 additions & 0 deletions zenoh/src/net/runtime/orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ impl Runtime {
}

async fn bind_listeners(&self, listeners: &[EndPoint]) -> ZResult<()> {
if listeners.is_empty() {
tracing::warn!("Starting with no listener endpoints!");
return Ok(());
}
let timeout = self.get_global_listener_timeout();
if timeout.is_zero() {
self.bind_listeners_impl(listeners).await
Expand Down

0 comments on commit 9a73585

Please sign in to comment.