nerves_dnssd v0.3.1 Nerves.Dnssd.ServiceRegistration View Source
Ensure a service name survives an application restart.
The common interface is through Nerves.Dnssd.register()
For example: I have 2 services on
my network, both competing for a service name “Foo Service”. The first service to
be available on the network is claiming this name, hence the service that starts
second will be named “Foo Service (2)”. For the second service we need to persist
this name, so that when the service starts up again it will advertise itself as
“Foo Service (2)” (even if the first service is no longer available on the network).
To achieve this, we apply a simple name mapping: if a name is registered for and the service knows internally it has been using another name in the past, it will use the name used before.
Note that this module only handles the simple case where we want to register a
{name, protocol, port}
tuple on a .local
domain using the current host name.