diff --git a/Cargo.lock b/Cargo.lock index a0fae9e931c5..b18f4230ddb0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2254,10 +2254,10 @@ dependencies = [ "image", "itertools", "mimalloc", - "re_comms", "re_log_types", "re_viewer", "re_web_server", + "re_ws_comms", "tokio", "tracing", "tracing-subscriber", @@ -2305,10 +2305,10 @@ dependencies = [ "itertools", "mimalloc", "prost", - "re_comms", "re_log_types", "re_viewer", "re_web_server", + "re_ws_comms", "tokio", "tracing", "tracing-subscriber", @@ -2692,23 +2692,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "re_comms" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "ewebsock", - "futures-channel", - "futures-util", - "parking_lot 0.12.0", - "re_log_types", - "tokio", - "tokio-tungstenite", - "tracing", - "tungstenite", -] - [[package]] name = "re_data_store" version = "0.1.0" @@ -2779,10 +2762,10 @@ dependencies = [ "puffin", "puffin_http", "rand", - "re_comms", "re_data_store", "re_log_types", "re_string_interner", + "re_ws_comms", "rfd", "serde", "serde_json", @@ -2806,6 +2789,23 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "re_ws_comms" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "ewebsock", + "futures-channel", + "futures-util", + "parking_lot 0.12.0", + "re_log_types", + "tokio", + "tokio-tungstenite", + "tracing", + "tungstenite", +] + [[package]] name = "redox_syscall" version = "0.2.13" diff --git a/Cargo.toml b/Cargo.toml index e5ede6b0dd8c..a9ce270a3030 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [workspace] resolver = "2" members = [ - "crates/re_comms", "crates/re_data_store", "crates/re_log_types", "crates/re_string_interner", "crates/re_viewer", "crates/re_web_server", + "crates/re_ws_comms", "examples/nyud", "examples/objectron", diff --git a/check.sh b/check.sh index 220b4fc1366a..aad4ceda9a1a 100755 --- a/check.sh +++ b/check.sh @@ -16,17 +16,17 @@ cargo test --workspace --doc --all-features cargo doc --lib --no-deps --all-features cargo doc --document-private-items --no-deps --all-features -(cd crates/re_comms && cargo check --no-default-features) (cd crates/re_log_types && cargo check --no-default-features) (cd crates/re_viewer && cargo check --no-default-features --lib) (cd crates/re_web_server && cargo check --no-default-features) +(cd crates/re_ws_comms && cargo check --no-default-features) (cd examples/nyud && cargo check --no-default-features) (cd examples/objectron && cargo check --no-default-features) -(cd crates/re_comms && cargo check --all-features) (cd crates/re_log_types && cargo check --all-features) (cd crates/re_viewer && cargo check --all-features) (cd crates/re_web_server && cargo check --all-features) +(cd crates/re_ws_comms && cargo check --all-features) (cd examples/nyud && cargo check --all-features) (cd examples/objectron && cargo check --all-features) diff --git a/crates/re_viewer/Cargo.toml b/crates/re_viewer/Cargo.toml index ae2376f2f67d..6fedaa318bd3 100644 --- a/crates/re_viewer/Cargo.toml +++ b/crates/re_viewer/Cargo.toml @@ -17,7 +17,7 @@ puffin = ["dep:puffin", "dep:puffin_http", "eframe/puffin"] [dependencies] -re_comms = { path = "../re_comms", features = ["client"] } +re_ws_comms = { path = "../re_ws_comms", features = ["client"] } re_data_store = { path = "../re_data_store", features = ["puffin"] } re_log_types = { path = "../re_log_types", features = ["save", "load"] } re_string_interner = { path = "../re_string_interner" } diff --git a/crates/re_viewer/README.md b/crates/re_viewer/README.md index 9713997da89c..3cd0918a7c18 100644 --- a/crates/re_viewer/README.md +++ b/crates/re_viewer/README.md @@ -4,6 +4,6 @@ This is the main crate with all the GUI. This is both a library and a binary. Can be compiled both natively for desktop, and as WASM for web. -Talks to the server over WebSockets (using `re_comms`). +Talks to the server over WebSockets (using `re_ws_comms`). `cargo run --release -p re_viewer -- --help` diff --git a/crates/re_viewer/src/main.rs b/crates/re_viewer/src/main.rs index 39ebea7c2d02..ed537370994e 100644 --- a/crates/re_viewer/src/main.rs +++ b/crates/re_viewer/src/main.rs @@ -50,9 +50,9 @@ async fn main() { ); } else { let mut url = args.url_or_path; - // let url = re_comms::default_server_url(); + // let url = re_ws_comms::default_server_url(); if !url.contains("://") { - url = format!("{}://{url}", re_comms::PROTOCOL); + url = format!("{}://{url}", re_ws_comms::PROTOCOL); } eframe::run_native( "rerun viewer", diff --git a/crates/re_viewer/src/remote_viewer_app.rs b/crates/re_viewer/src/remote_viewer_app.rs index ada833e11e90..ec0c6a14fa0a 100644 --- a/crates/re_viewer/src/remote_viewer_app.rs +++ b/crates/re_viewer/src/remote_viewer_app.rs @@ -4,7 +4,7 @@ use crate::App; #[derive(Default)] pub struct RemoteViewerApp { url: String, - app: Option<(re_comms::Connection, App)>, + app: Option<(re_ws_comms::Connection, App)>, } impl RemoteViewerApp { @@ -22,7 +22,7 @@ impl RemoteViewerApp { fn connect(&mut self, egui_ctx: egui::Context, storage: Option<&dyn eframe::Storage>) { let (tx, rx) = std::sync::mpsc::channel(); - let connection = re_comms::Connection::viewer_to_server( + let connection = re_ws_comms::Connection::viewer_to_server( self.url.clone(), move |data_msg: re_log_types::LogMsg| { if tx.send(data_msg).is_ok() { diff --git a/crates/re_viewer/src/web.rs b/crates/re_viewer/src/web.rs index e050e86b501c..758db6af8d70 100644 --- a/crates/re_viewer/src/web.rs +++ b/crates/re_viewer/src/web.rs @@ -36,7 +36,7 @@ fn get_url(info: &eframe::IntegrationInfo) -> String { } } if url.is_empty() { - re_comms::default_server_url() + re_ws_comms::default_server_url() } else { url } diff --git a/crates/re_comms/Cargo.toml b/crates/re_ws_comms/Cargo.toml similarity index 98% rename from crates/re_comms/Cargo.toml rename to crates/re_ws_comms/Cargo.toml index dbd167986f8e..ddc6fd2d094a 100644 --- a/crates/re_comms/Cargo.toml +++ b/crates/re_ws_comms/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "re_comms" +name = "re_ws_comms" version = "0.1.0" edition = "2021" rust-version = "1.62" diff --git a/crates/re_comms/README.md b/crates/re_ws_comms/README.md similarity index 100% rename from crates/re_comms/README.md rename to crates/re_ws_comms/README.md diff --git a/crates/re_comms/src/client.rs b/crates/re_ws_comms/src/client.rs similarity index 100% rename from crates/re_comms/src/client.rs rename to crates/re_ws_comms/src/client.rs diff --git a/crates/re_comms/src/lib.rs b/crates/re_ws_comms/src/lib.rs similarity index 90% rename from crates/re_comms/src/lib.rs rename to crates/re_ws_comms/src/lib.rs index 55fbce60bb02..a3e6181c3a42 100644 --- a/crates/re_comms/src/lib.rs +++ b/crates/re_ws_comms/src/lib.rs @@ -14,7 +14,7 @@ use re_log_types::LogMsg; pub type Result = anyhow::Result; -pub const DEFAULT_SERVER_PORT: u16 = 9876; +pub const DEFAULT_WS_SERVER_PORT: u16 = 9876; #[cfg(feature = "tls")] pub const PROTOCOL: &str = "wss"; @@ -23,7 +23,7 @@ pub const PROTOCOL: &str = "wss"; pub const PROTOCOL: &str = "ws"; pub fn default_server_url() -> String { - format!("{PROTOCOL}://127.0.0.1:{DEFAULT_SERVER_PORT}") + format!("{PROTOCOL}://127.0.0.1:{DEFAULT_WS_SERVER_PORT}") } const PREFIX: [u8; 4] = *b"RR00"; diff --git a/crates/re_comms/src/server.rs b/crates/re_ws_comms/src/server.rs similarity index 100% rename from crates/re_comms/src/server.rs rename to crates/re_ws_comms/src/server.rs diff --git a/examples/nyud/Cargo.toml b/examples/nyud/Cargo.toml index 266863129bac..75a694416d30 100644 --- a/examples/nyud/Cargo.toml +++ b/examples/nyud/Cargo.toml @@ -9,7 +9,7 @@ publish = false [features] default = [] -web = ["re_comms", "re_web_server", "tokio", "webbrowser"] +web = ["re_ws_comms", "re_web_server", "tokio", "webbrowser"] [dependencies] @@ -28,7 +28,7 @@ tracing-subscriber = "0.3" zip = { version = "0.6", default-features = false, features = ["deflate"] } # Optional: -re_comms = { path = "../../crates/re_comms", optional = true, features = ["server"] } +re_ws_comms = { path = "../../crates/re_ws_comms", optional = true, features = ["server"] } re_web_server = { path = "../../crates/re_web_server", optional = true } tokio = { version = "1.0.0", optional = true, default-features = false, features = [ "io-std", diff --git a/examples/nyud/src/main.rs b/examples/nyud/src/main.rs index 9eb3382027af..7465387132e1 100644 --- a/examples/nyud/src/main.rs +++ b/examples/nyud/src/main.rs @@ -74,9 +74,9 @@ async fn main() -> Result<(), Box> { } }); - let pub_sub_url = re_comms::default_server_url(); + let pub_sub_url = re_ws_comms::default_server_url(); - let server = re_comms::Server::new(re_comms::DEFAULT_SERVER_PORT).await?; + let server = re_ws_comms::Server::new(re_ws_comms::DEFAULT_WS_SERVER_PORT).await?; let server_handle = tokio::spawn(server.listen(rerun_rx)); let web_port = 9090; diff --git a/examples/objectron/Cargo.toml b/examples/objectron/Cargo.toml index dfad75c540de..12421e057e52 100644 --- a/examples/objectron/Cargo.toml +++ b/examples/objectron/Cargo.toml @@ -9,7 +9,7 @@ publish = false [features] default = [] -web = ["re_comms", "re_web_server", "tokio", "webbrowser"] +web = ["re_ws_comms", "re_web_server", "tokio", "webbrowser"] [dependencies] @@ -27,7 +27,7 @@ tracing = "0.1" tracing-subscriber = "0.3" # Optional: -re_comms = { path = "../../crates/re_comms", optional = true, features = ["server"] } +re_ws_comms = { path = "../../crates/re_ws_comms", optional = true, features = ["server"] } re_web_server = { path = "../../crates/re_web_server", optional = true } tokio = { version = "1.0.0", optional = true, default-features = false, features = [ "io-std", diff --git a/examples/objectron/src/main.rs b/examples/objectron/src/main.rs index f1cc8605cb43..f96109bcd174 100644 --- a/examples/objectron/src/main.rs +++ b/examples/objectron/src/main.rs @@ -74,9 +74,9 @@ async fn main() -> Result<(), Box> { } }); - let pub_sub_url = re_comms::default_server_url(); + let pub_sub_url = re_ws_comms::default_server_url(); - let server = re_comms::Server::new(re_comms::DEFAULT_SERVER_PORT).await?; + let server = re_ws_comms::Server::new(re_ws_comms::DEFAULT_WS_SERVER_PORT).await?; let server_handle = tokio::spawn(server.listen(rerun_rx)); let web_port = 9090;