MDNSServiceType
Platform-neutral mDNS service-type wrapper.
Holds the canonical base form — e.g. "_myapp._tcp" — and normalizes to each mDNS API's required format internally. Callers never need to know which suffix a given platform expects.
Canonical form
Pass the service type without any trailing dot or .local. suffix:
MDNSServiceType("_myapp._tcp")Content copied to clipboard
Per-platform normalization
| Platform | API | Required format | Method |
|---|---|---|---|
| JVM | JmDNS | "_myapp._tcp.local." | forJmDns |
| Android | NsdManager | "_myapp._tcp." | forNsd |
| iOS / macOS | NSNetServiceBrowser | "_myapp._tcp." | forNsNetServiceBrowser |
The normalization strips any existing suffix before appending the expected one, so callers that accidentally pass a pre-suffixed string still get a correct result.