mdns

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advertiser

type Advertiser struct {
	// contains filtered or unexported fields
}

Advertiser manages mDNS hostname advertisements for simulators. Uses the system's native mDNS daemon (dns-sd on macOS, avahi on Linux) for reliable hostname resolution on the local network.

func New

func New() *Advertiser

New creates a new Advertiser.

func (*Advertiser) ActiveHostname

func (a *Advertiser) ActiveHostname(simID int) string

ActiveHostname returns the hostname being advertised for a simulator, or empty string if none.

func (*Advertiser) Advertise

func (a *Advertiser) Advertise(simID int, hostname string, port int, serviceType string, ip string, txt []string) error

Advertise starts advertising a hostname via mDNS for the given simulator. If the hostname is already in use (internally or on the network), it appends -1, -2, etc. until an unused name is found. Returns nil on success. A no-op if hostname is empty.

func (*Advertiser) Remove

func (a *Advertiser) Remove(simID int)

Remove stops the mDNS advertisement for a simulator.

func (*Advertiser) Shutdown

func (a *Advertiser) Shutdown()

Shutdown stops all mDNS advertisements.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL