Closed jamessanford closed 6 years ago
With the above PR applied, it works as expected on Linux, and it continues to work on OSX.
linux% ./hklight
osx% cd $GOPATH/src/github.com/brutella/dnssd/_cmd
osx% go run browse.go
Browsing for _hap._tcp.local.
DATE: –––Wed Nov 22 2017–––
22:28:00.852 ...STARTING...
Timestamp A/R Domain Service Type Service Name
22:28:00.973 Add local. _hap._tcp. Personal_Light_Bulb
osx% tcpdump -n -p -v -i en4 port 5353
tcpdump: listening on en4, link-type EN10MB (Ethernet), capture size 262144 bytes
22:28:00.852629 IP (tos 0x0, ttl 1, id 26358, offset 0, flags [none], proto UDP (17), length 61)
192.168.1.40.5353 > 224.0.0.251.5353: 0 PTR (QM)? _hap._tcp.local. (33)
22:28:00.972778 IP (tos 0x0, ttl 1, id 36682, offset 0, flags [DF], proto UDP (17), length 414)
192.168.1.20.5353 > 224.0.0.251.5353: 0*- [0q] 1/0/4 _hap._tcp.local. PTR Personal_Light_Bulb._hap._tcp.local. (386)
22:28:00.972827 IP6 (flowlabel 0x9cedb, hlim 1, next-header UDP (17) payload length: 394) fe80::dfff:7fff:aaaa:aaaa.5353 > ff02::fb.5353: [udp sum ok] 0*- [0q] 1/0/4 _hap._tcp.local. PTR Personal_Light_Bulb._hap._tcp.local. (386)
The service appears, but after two minutes, is removed:
If you run tcpdump and run
browse.go
, you can see lookup packets but no answer.