wotpy.wot.discovery.dnssd.service

Service discovery based on Multicast DNS and DNS-SD (Bonjour, Avahi).

Functions

build_servient_service_info(servient[, …]) Takes a Servient and optional IP address and builds the zeroconf ServiceInfo that describes the WoT Servient service.

Classes

DNSSDDiscoveryService([address]) Manages a DNS Service Discovery service (based on Multicast DNS) that is run on a separate thread (on a loop executor) to discover link-local WoT Servients and expose its own.
class wotpy.wot.discovery.dnssd.service.DNSSDDiscoveryService(address=None)

Bases: object

Manages a DNS Service Discovery service (based on Multicast DNS) that is run on a separate thread (on a loop executor) to discover link-local WoT Servients and expose its own.

WOT_SERVICE_TYPE = '_wot-servient._tcp.local.'
find(min_results=None, timeout=5)

Browses the link to discover WoT Servient services using mDNS. Returns a list of (ip_address, port). If min_results is defined it will stop as soon as that number of results are found.

is_running

Returns True if the mDNS service is currently running.

register(servient, instance_name=None)

Takes a Servient and registers the TD catalogue service for discovery by other hosts in the same link.

start()

Starts the DNS-SD thread on a loop executor.

stop()

Signals the DNS-SD thread to stop and waits for the executor future to yield.

unregister(servient, instance_name=None)

Takes a Servient and unregisters the TD catalogue service.

wotpy.wot.discovery.dnssd.service.build_servient_service_info(servient, address=None, instance_name=None)

Takes a Servient and optional IP address and builds the zeroconf ServiceInfo that describes the WoT Servient service.