diff --git a/commons/zenoh-config/Cargo.toml b/commons/zenoh-config/Cargo.toml index 43472626d..0a650d5d4 100644 --- a/commons/zenoh-config/Cargo.toml +++ b/commons/zenoh-config/Cargo.toml @@ -25,6 +25,7 @@ description = "Internal crate for zenoh." [features] internal = [] +transport_tcp = [] [dependencies] tracing = { workspace = true } diff --git a/commons/zenoh-config/src/defaults.rs b/commons/zenoh-config/src/defaults.rs index edf2c46c7..da10d7b79 100644 --- a/commons/zenoh-config/src/defaults.rs +++ b/commons/zenoh-config/src/defaults.rs @@ -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, diff --git a/io/zenoh-link/Cargo.toml b/io/zenoh-link/Cargo.toml index 64f0dc053..19f81c0f3 100644 --- a/io/zenoh-link/Cargo.toml +++ b/io/zenoh-link/Cargo.toml @@ -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"] diff --git a/io/zenoh-transport/Cargo.toml b/io/zenoh-transport/Cargo.toml index 2fd74c8b0..23dc24b43 100644 --- a/io/zenoh-transport/Cargo.toml +++ b/io/zenoh-transport/Cargo.toml @@ -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"] diff --git a/zenoh/Cargo.toml b/zenoh/Cargo.toml index 94f6d6eb4..ece72ab5c 100644 --- a/zenoh/Cargo.toml +++ b/zenoh/Cargo.toml @@ -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"] diff --git a/zenoh/src/net/runtime/orchestrator.rs b/zenoh/src/net/runtime/orchestrator.rs index 1ed468bbf..bd3cf0a15 100644 --- a/zenoh/src/net/runtime/orchestrator.rs +++ b/zenoh/src/net/runtime/orchestrator.rs @@ -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