Repository navigation
Conversation
kgoderis
force-pushed
the
feature/native-dnssd-advertiser
branch
from
October 22, 2026 19:12
175f81a to
fb1842f
Compare
Pluggable HomekitAdvertiser lets callers use DnssdHomekitAdvertiser (JNA DNSServiceRegister) instead of JmDNS when mDNSResponder owns UDP 5353. Fixes hap-java#212.
kgoderis
force-pushed
the
feature/native-dnssd-advertiser
branch
from
October 22, 2026 19:12
fb1842f to
9c032ca
Compare
Author
|
@yfre Eugen, this PR is necessary for a downstream fix in openHab openhab/openhab-addons#22013 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a pluggable
HomekitAdvertiserand a native DNS-SD / Bonjour implementation (DnssdHomekitAdvertiser) that registers_hap._tcpviaDNSServiceRegister(JNA) without binding UDP 5353. Existing JmDNS constructors keep working. Factories live onHomekitAdvertisers(nativeDnssd(),auto(...), etc.). Seedocs/NATIVE_DNSSD.md.Why
Fixes #212. On macOS,
mDNSResponderowns UDP 5353, so a dedicated JmDNS advertiser fails with “Address already in use” / “no suitable mDNS” and Home never discovers the accessory.Compatibility
HomekitServer/HomekitRootoverloads that takeHomekitAdvertiser.InetAddress/JmDNSconstructors unchanged.net.java.dev.jna:jna(5.14.0) for the native path only. JmDNS-only users still pull the jar transitively unless they exclude it; native symbols come from macOSlibSystemor Avahilibdns_sd.Testing
mvn -B packageon JDK 11: 34 tests, 0 failures (CI-equivalent).hap-java-fake-demo;dns-sd -B/-L/-Zshowed PTR/SRV/TXT; Java process had no UDP 5353 socket.Checklist
CHANGES.mdmvn compile/ Google Java Format (fmt-maven-plugin)