From f5384e4e99fe285ff333b934819f910f15c0e0bb Mon Sep 17 00:00:00 2001 From: Sandeepa Nadahalli <1698507+snadahalli@users.noreply.github.com> Date: Wed, 26 Aug 2026 15:20:12 +0530 Subject: [PATCH] fix(receiver): stop claiming the receiver is listening when it is not MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A colleague ran the receiver on a Linux box and could not see it from the sender. Nothing was wrong with their setup: `openplay-receiver` depends only on `openplay-common`, `egui`, `eframe`, `clap`, `anyhow` and `tracing` — it pulls in neither `openplay-discovery` nor `openplay-signaling`, so it cannot advertise over mDNS and cannot accept a connection. Confirmed on the wire: the host pinged fine, ports 7290/7000/7236 were all closed, and a 15-second `dns-sd -B _openplay._tcp` returned nothing while `_airplay._tcp` returned 16 results from the same machine at the same moment. Three separate things told them otherwise: - `--name`'s help said "shown in mDNS discovery". The flag does work, but it sets the window heading; nothing advertises it. - `--port`'s help said "Override signaling port". Nothing binds it. - The window itself rendered "Listening on port 7290". The last one is the worst, because it is the one a user actually sees, and it is unambiguous: it says the receiver is listening. It never was. Make all three honest. `--name` now says it affects the window and explicitly not discovery; `--port` is marked reserved and logs a warning when passed, so the effect-free flag announces itself at the point of use; and the waiting page says the receiver is a placeholder that advertises nothing and accepts no connections, pointing at #11. No behaviour change beyond the warning — this is the same non-functional receiver, now describing itself accurately. --- crates/openplay-receiver/src/main.rs | 20 +++++++++++++++++--- crates/openplay-receiver/src/window.rs | 21 ++++++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/crates/openplay-receiver/src/main.rs b/crates/openplay-receiver/src/main.rs index 7202d0a..b69ac71 100644 --- a/crates/openplay-receiver/src/main.rs +++ b/crates/openplay-receiver/src/main.rs @@ -2,7 +2,7 @@ mod app; mod window; use clap::Parser; -use tracing::info; +use tracing::{info, warn}; /// OpenPlay Receiver — Display incoming screen casts. #[derive(Parser, Debug)] @@ -12,11 +12,18 @@ struct Args { #[arg(long)] config: Option, - /// Override display name (shown in mDNS discovery). + /// Override display name (shown in the receiver window). + /// + /// This does *not* affect discovery: the receiver does not advertise + /// itself over mDNS yet, so no sender can find it by name. #[arg(long)] name: Option, - /// Override signaling port. + /// Override signaling port. Reserved — has no effect yet. + /// + /// The receiver does not open a socket, so nothing binds this port. It is + /// accepted and validated so the flag keeps working once the signaling + /// server is wired up. #[arg(long)] port: Option, } @@ -36,6 +43,13 @@ fn main() -> anyhow::Result<()> { config.display_name = name.clone(); } if let Some(port) = args.port { + // Validated and stored, but nothing binds it: the receiver has no + // signaling server yet. Say so rather than letting the flag imply the + // receiver is reachable on that port. + warn!( + port, + "--port has no effect yet: this receiver does not listen for connections" + ); config.port = port; } diff --git a/crates/openplay-receiver/src/window.rs b/crates/openplay-receiver/src/window.rs index 07986bf..17a3828 100644 --- a/crates/openplay-receiver/src/window.rs +++ b/crates/openplay-receiver/src/window.rs @@ -18,7 +18,13 @@ impl ReceiverWindow { Self { config } } - /// The page shown while no sender is connected. + /// The page shown while the receiver cannot yet be reached. + /// + /// This deliberately does not say "waiting for a sender" or "listening on + /// port N". Neither was ever true: the receiver opens no socket and + /// advertises no mDNS service, so a sender cannot discover it or connect to + /// it. Claiming otherwise sent at least one person debugging their network + /// for a feature that does not exist. /// // TODO: Phase 1 — once the receiver pipeline is wired up, swap this for the // decoded video frames and go fullscreen when a sender connects. @@ -27,10 +33,19 @@ impl ReceiverWindow { ui.add_space(ui.available_height() * 0.25); ui.heading(&self.config.display_name); ui.add_space(8.0); - ui.label("Waiting for a sender to connect..."); + ui.label("Not reachable yet — this receiver is a placeholder."); ui.add_space(16.0); ui.label( - RichText::new(format!("Listening on port {}", self.config.port)) + RichText::new( + "It does not advertise itself over mDNS and accepts no\n\ + connections, so senders cannot discover or reach it.", + ) + .color(Color32::GRAY), + ); + ui.add_space(8.0); + ui.label( + RichText::new("Tracking: Developer1010x/openplay#11") + .small() .color(Color32::GRAY), ); });