macula_dist_mdns_advertiser (macula v0.14.3)

View Source

Macula Distribution mDNS Advertiser.

This module implements the mdns advertiser behaviour from the shortishly/mdns library. It advertises Macula distribution nodes via mDNS for automatic discovery on local networks.

Usage: %% Start advertising mdns_advertise_sup:start_child(macula_dist_mdns_advertiser).

%% Stop advertising mdns_advertise:stop(macula_dist_mdns_advertiser).

Summary

Functions

Return the list of service instances to advertise. Each instance is a map with: - instance: Full instance name - priority: SRV record priority (lower = preferred) - weight: SRV record weight for load balancing - port: The port the service is running on - hostname: The hostname without domain - properties: TXT record key-value pairs

Register this node for mDNS advertisement.

Return the mDNS service type. This follows the standard format: _service._protocol.local.

Unregister this node from mDNS advertisement.

Functions

instances()

-spec instances() -> [map()].

Return the list of service instances to advertise. Each instance is a map with: - instance: Full instance name - priority: SRV record priority (lower = preferred) - weight: SRV record weight for load balancing - port: The port the service is running on - hostname: The hostname without domain - properties: TXT record key-value pairs

register(NodeName, Port)

-spec register(atom() | string(), pos_integer()) -> ok.

Register this node for mDNS advertisement.

service()

-spec service() -> string().

Return the mDNS service type. This follows the standard format: _service._protocol.local.

unregister()

-spec unregister() -> ok.

Unregister this node from mDNS advertisement.