Zum Hauptinhalt springen

raydriver.core.discovery.mdns_scan

MDNSService​

One service resolved during an mDNS browse.

host​

host: str

Address to connect to; IPv4 preferred over IPv6.

name​

name: str

Instance name, e.g. OctoPrint on octopi.

port​

port: int

server​

server: str

The server's own hostname, e.g. octopi.local.

service_type​

service_type: str

Normalized service type, e.g. _octoprint._tcp.

txt​

txt: dict

TXT record contents, values decoded to strings.

Functions​

normalize_service_type()​

normalize_service_type(service_type: str) -> str

Reduces a service type to its canonical _name._transport form: _octoprint._tcp.local. becomes _octoprint._tcp.

ParameterTypeDescription
service_typestr
Returnsstr

scan_mdns_services()​

scan_mdns_services(
service_types: Iterable[str],
browse_window: float = 2.0,
) -> Any

Browses service_types over mDNS for a short window and returns every service that could be resolved to an address. Failures (no network, no responder) are logged and yield an empty list rather than raising.

ParameterTypeDescription
service_typesIterable[str]
browse_windowfloat = 2.0
ReturnsAny