jbagg / QtZeroConf

Qt wrapper class for ZeroConf libraries across various platforms.
Other
69 stars 51 forks source link

Services disappear on macOS Catalina #30

Open agentsim opened 4 years ago

agentsim commented 4 years ago

I'm able to consistently reproduce a problem with services disappearing when the broadcasting application is terminated and not re-appearing when the broadcast is restarted.

I get the serviceAdded signal when the broadcaster is initially launched. If I terminate the broadcaster I get the serviceRemoved signal. However when I restart the broadcaster I get neither serviceAdded nor serviceUpdated.

This happens 100% of the time on macOS Catalina. The broadcast is done using native libraries and I can see the service appear an disappear in Discovery so I'm fairly certain the broadcast is done properly.

jbagg commented 4 years ago

the service appear an disappear in Discovery

  1. Do you see the service appear in the Discovery app on the same machine as the broadcast app or a different machine?

However when I restart the broadcaster I get neither serviceAdded nor serviceUpdated.

  1. How long have you waited for it to re-appear. zeroconf timeouts are something like 1-2 min.

  2. Do you have a linux PC you can put on the same network? Linux has a program called avahi-discover which is a service browers like the macOS Discovery app. It would be interesting to see what avahi-discover does.

  3. Have you tired the example in QfZeroConf? What happens when you enable and disable the service in the example program?

agentsim commented 4 years ago
  1. Do you see the service appear in the Discovery app on the same machine as the broadcast app or a different machine?

Same machine. My app is also running on the same machine.

  1. How long have you waited for it to re-appear. zeroconf timeouts are something like 1-2 min.

30-45 seconds. I'll try again waiting longer. That said, the service reappears within 10s in Discovery.

  1. Do you have a linux PC you can put on the same network? Linux has a program called avahi-discover which is a service browers like the macOS Discovery app. It would be interesting to see what avahi-discover does.

I was originally developing on Linux (Ubuntu 18.04.) Under Linux the services appeared, disappeared and re-appeared correctly. I have made minor changes to my code since explicitly testing this, so I'll have to try again.

  1. Have you tired the example in QfZeroConf? What happens when you enable and disable the service in the example program?

No I haven't. I'll look into doing that and report back.

jbagg commented 4 years ago

I would try Discovery on a second mac with your app on the first mac and/or avahi-discover on a linux box with your app on the mac.

agentsim commented 4 years ago

I'll certainly try that, however I'm not sure what it would prove.

Discovery and the broadcaster both running on my Mac works nicely, with the service showing up within 10 seconds of being restarted.

My app using QtZeroConf and the broadcaster both running on my Mac results in the restarted service never appearing.

That delta in behaviour seems (to me) to be indicative of a bug even if I cannot reproduce it across machines.