hap-java / HAP-Java

Java implementation of the HomeKit Accessory Protocol
MIT License
153 stars 82 forks source link

docker - HomeKitServer - HomekitRoot constructor with JmdnsHomekitAdvertiser never called #100

Closed gpr7700 closed 4 years ago

gpr7700 commented 4 years ago

Environment

Issue The bridge (_hap._tcp) is never advertised when specifying the host container ip address. With container ip address bridge is advertised.

When looking at the code it seems that HomeKitServer (createBridge) never calls the HomekitRoot constructor that takes the JmdnsHomekitAdvertiser instance. Therefore the bridge is not advertised and you have no logs at all to investigate why something is going wrong.

Regards

Gregory

J-N-K commented 4 years ago

Why should it call that constructor? If no advertiser is given, a new one is created and passed to the very same constructor that would be used if you pass an advertiser.

gpr7700 commented 4 years ago

Hi, my mistake, you're right ! But I cannot explain why the bridge is not advertised when I specify the ip address of the host container, and advertised when the ip address of the docker container is specified. From within the container, the host is reachable (ping).

yfre commented 4 years ago

@gpr7700 can we close this or is anything needs to be fixed in java hap code?

gpr7700 commented 4 years ago

@yfre can be closed. As a workaround I configured docker with network mode : host.