Search documentation of macula

# macula_dist_mdns_advertiser (macula v0.44.2)

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

instances()

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)

Register this node for mDNS advertisement.

service()

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

unregister()

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.