Skip to content

Commit

Permalink
Rename re_comms to re_ws_comms
Browse files Browse the repository at this point in the history
It is for the websocket connection between server and viewer.

There will soon be another crate for the TCP connection between
SDK and server.
  • Loading branch information
emilk committed Jul 8, 2022
1 parent 0b478cf commit 5a4dd36
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 41 deletions.
40 changes: 20 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion crates/re_viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion crates/re_viewer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
4 changes: 2 additions & 2 deletions crates/re_viewer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions crates/re_viewer/src/remote_viewer_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion crates/re_viewer/src/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "re_comms"
name = "re_ws_comms"
version = "0.1.0"
edition = "2021"
rust-version = "1.62"
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions crates/re_comms/src/lib.rs → crates/re_ws_comms/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use re_log_types::LogMsg;

pub type Result<T> = anyhow::Result<T>;

pub const DEFAULT_SERVER_PORT: u16 = 9876;
pub const DEFAULT_WS_SERVER_PORT: u16 = 9876;

#[cfg(feature = "tls")]
pub const PROTOCOL: &str = "wss";
Expand All @@ -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";
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/nyud/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions examples/nyud/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}
});

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;
Expand Down
4 changes: 2 additions & 2 deletions examples/objectron/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions examples/objectron/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}
});

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;
Expand Down

0 comments on commit 5a4dd36

Please sign in to comment.