switchy_mdns
mDNS service registration for MoosicBox servers.
Features
- Service Registration: Register MoosicBox servers on the local network via mDNS
- Simulator: Simulated mDNS daemon for testing (enabled by default)
Cargo Features
| Feature | Default | Description |
|---|---|---|
simulator |
Yes | Provides a simulated mDNS daemon for testing |
fail-on-warnings |
No | Enables strict warning handling through the moosicbox_assert crate |
Installation
[]
= "0.1.4"
# Or disable default features (disables the simulator)
= { = "0.1.4", = false }
Usage
Registering a Service
use register_service;
async
Public API
register_service(instance_name, ip, port): Registers a MoosicBox mDNS service instanceSERVICE_TYPE: The service type constant used for registration (_moosicboxserver._tcp.local.)RegisterServiceError: Error type returned byregister_serviceRegisterServiceError::MdnsSd: Underlyingmdns_sddaemon or registration errorRegisterServiceError::IO: Hostname lookup I/O error
switchy_mdns::service::MdnsServiceDaemon: Trait abstraction for service daemon implementationsswitchy_mdns::service::MdnsSdServiceDaemon: Wrapper for realmdns_sd::ServiceDaemonswitchy_mdns::service::simulator::SimulatorServiceDaemon: Simulator daemon (available withsimulatorfeature)
License
This project is licensed under the MPL-2.0 License.