Expand description
The UDP broadcast provider: the controlled fallback for segments where multicast is
filtered. Same protocol, same port, no second serialization — only the destination
differs: the limited broadcast address in auto mode, or the directed broadcast
addresses the declaration lists in explicit mode. Never auto by default, and it
does not spray interfaces: one socket, the destinations named above, nothing more.
Transmit-first by design: when the multicast provider runs, its socket already hears everything aimed at the port and a second bound socket would fight it for the address. This provider binds a listener only when it is the sole UDP provider.
use majordomus_cli::mesh::broadcast::BroadcastProvider;
use majordomus_cli::mesh::config::{BroadcastConfig, BroadcastMode};
use majordomus_cli::mesh::provider::{MeshProvider, MeshProviderState};
// A disabled declaration yields a provider that starts nothing and says so.
let provider = BroadcastProvider::new(BroadcastConfig::default(), false);
let status = provider.status();
assert_eq!(status.id, "udp_broadcast");
assert_eq!(status.state, MeshProviderState::Stopped);
assert_eq!(status.sent, 0);Structs§
- Broadcast
Provider - The broadcast provider: the declared destinations, the counters its threads share, and the state its status reports. Constructed by the manager from the declaration.