Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default config listen endpoints when transport_tcp feature is disabled #1623

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading