zeroconf icon indicating copy to clipboard operation
zeroconf copied to clipboard

published ip address not change when I switch network

Open leslie-wang opened this issue 6 years ago • 4 comments

One mdns daemon service published ip address 10.240.138.74, which is its current ip address. like the screen shot Screen Shot 2019-04-23 at 11 14 19 PM

After switch over network, its ip has changed to 10.0.1.2, but published ip address is still 10.240.138.74 Screen Shot 2019-04-23 at 10 59 58 PM

leslie-wang avatar Apr 24 '19 06:04 leslie-wang

One option is to listen for network interface changes (https://stackoverflow.com/a/50220033/332798) and then refresh/reload the mdns service.

tmm1 avatar Apr 24 '19 07:04 tmm1

Yes, that is what I'm going to do before zeroconf solves it. I guess RTNETLINK socket is not supported in windows now. Anyway, I'll try. Thanks for pointing the link.

leslie-wang avatar Apr 24 '19 14:04 leslie-wang

@tmm1 do you have any good idea to listen for network interface change at windows?

leslie-wang avatar Apr 26 '19 06:04 leslie-wang

Yes, see https://gist.github.com/LiamHaworth/72f96c28fc90936904ba70ae5299218f and https://stackoverflow.com/questions/44699710/calling-notifyipinterfacechange-from-go-caused-access-violation-exceptions

tmm1 avatar Apr 26 '19 06:04 tmm1