MdnsDiscovery class final

Finds media servers on the local network (VM / desktop; Flutter mobile apps use BonsoirDiscovery from freedome_flutter, 02f §8.1). Records are keyed by the TXT id; addresses are re-resolved on every scan.

Implemented types

Constructors

MdnsDiscovery({Duration interval = const Duration(seconds: 10), MDnsClient clientFactory() = MDnsClient.new, bool preferIPv4 = true})
Creates a discovery; interval = rescan period of watch.

Properties

clientFactory → MDnsClient Function()
Creates the mDNS client (injectable for tests).
final
hashCode → int
The hash code for this object.
no setterinherited
interval → Duration
Rescan period of watch.
final
preferIPv4 → bool
Prefer IPv4 addresses.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scan({Duration timeout = const Duration(seconds: 3)}) → Future<List<DiscoveredDome>>
One scan.
override
toString() → String
A string representation of this object.
inherited
watch() → Stream<List<DiscoveredDome>>
Live list, debounced.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited