Skip to main content

Crate sdr_rtltcp_discovery

Crate sdr_rtltcp_discovery 

Source
Expand description

mDNS/DNS-SD discovery for rtl_tcp-compatible servers.

Provides:

  • Advertiser — for an rtl_tcp server to announce itself on the local network (e.g. the sdr-server-rtltcp crate uses this)
  • Browser — for an rtl_tcp client to find servers without the user manually typing host:port

Service type: _rtl_tcp._tcp.local. This is not an IANA-registered type — the SDR ecosystem uses it by convention (ShinySDR, rtl_tcp_client, etc.). Picking the same string means interop with those tools where they implement discovery.

§Pure-Rust stack

Uses mdns-sd — no Avahi / Bonjour system dependency, no async runtime. The daemon runs on its own thread internally; the Browser spawns a second thread that translates mdns-sd’s event channel into the domain events in this crate.

Structs§

AdvertiseOptions
Options for Advertiser::announce. All values except port have reasonable defaults derivable from the local environment, but the caller usually has richer metadata (tuner, gain count) already at hand from the server that’s being advertised.
Advertiser
Active advertisement. Drops → unregisters.
Browser
Live browser. Drops → stops listening and shuts the daemon down.
DiscoveredServer
A server visible on the local network.
TxtRecord
TXT record payload attached to a server advertisement. Each field serializes to key=value in the mDNS TXT record; missing fields are omitted entirely so older clients don’t see empty-string junk.

Enums§

DiscoveryError
Errors from advertiser / browser setup and runtime.
DiscoveryEvent
Events the browser emits to its callback.

Constants§

SERVICE_TYPE
Fully-qualified mDNS service type used by every rtl_tcp advertisement. This string is load-bearing for interop — any other tool that wants to browse us (or that we want to browse) must use the same literal.

Functions§

local_hostname
Best-effort local hostname lookup, returning the bare hostname without any .local. suffix. Useful as a default nickname for advertisement (callers who want the full mDNS form can append .local. themselves).