jbagg / QtZeroConf

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

problem when renewing connexion #32

Open jeremyczaicki opened 4 years ago

jeremyczaicki commented 4 years ago

Hi, I use qzeroconf in my app to discover Cisco devices. when i launch my app and start browser, i can get all my devices connected to the network, but when i unplug a device: 1)removeService is emitted 2) if i plug another device, i cannot see it 3)if i replug the device i unplugged, service does not appear anymore.

to resume, when i just unplug a device, no more service is added.

i am developing on Mac OS Mojave

Do you have a solution ?

jeremyczaicki commented 4 years ago

i have to stop and start browser 3 times to find my devices again, but even if one device is unplugged, it found it. can you help me ?

jbagg commented 4 years ago

Hi Jeremy,

I do not have any mac hardware at the moment as I am working from home due to covid-19. Could you please run the example and see if it has the same behaviour. Please also remember that TTL records are typically 120 seconds

jeremyczaicki commented 4 years ago

Hi, i ran exemple and it is the same issue. Yes, i see that TTL is 120 sec on wireshark. But if i stop browser and i start it again ? is there any solution to empty the cache ? the problem is also that if a device is removed i cannot add it anymore

jeremyczaicki commented 4 years ago

here, is my function to refresh mDNS browser:

void MainWindow::on_buttonn_refresh_clicked(){ if(zeroConf.browserExists()){ zeroConf.stopBrowser(); zeroConf.startBrowser(tr("_csco-sb._tcp")); } else if(!zeroConf.browserExists()){ zeroConf.startBrowser(tr("_csco-sb._tcp")); } }

is it correct ? because i have to click on 3 times before i can see my devices

mincequi commented 4 years ago

Same here: Apparently the resolverCallback is not called when calling: DNSServiceResolve (bonjour.cpp:88).

When I trigger startBrowser() 3 times, it works again.

jbagg commented 4 years ago

Can you see if the same issue exists one and two commits back?

8625824b8b298d86ee5d2867f4f483f84ff660d9 "Bonjour - need to keep resolvers around for updates"

and

c286fcd2c090b2b9bace0874b0e42e7084d15b4d "Change browser protocol options so it can only be IPv4 or IPv6, not both."

I don't have any apple hardware at the moment (covid-19 / working from home)

Jon

On 2020-03-29 4:23 p.m., Manuel wrote:

Same here: Apparently the resolverCallback is not called when calling: DNSServiceResolve (bonjour.cpp:88).

When I trigger startBrowser() 3 times, it works again.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jbagg/QtZeroConf/issues/32#issuecomment-605695120, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADFEL42WHQM4TD4JLO2XNPTRJ6U3TANCNFSM4LUSGGMA.

mincequi commented 4 years ago

8625824 "Bonjour - need to keep resolvers around for updates"

NOK

c286fcd "Change browser protocol options so it can only be IPv4 or IPv6, not both."

OK

Feel free to send patches for testing.

jeremyczaicki commented 4 years ago

sorry but i am not sure to understand what you want me to do ?

jbagg commented 4 years ago

Manuel (mincequi) found this issue is a result of commit 8625824. I don't need you to do anything at the moment. I am going into my work tomorrow to pick up some things. I can grab the old mac I've been testing with. You can use c286fcd for the time being. By rolling back to this older commit, you will loose the functionality of IP address updates if the IP address of a device changes.

jeremyczaicki commented 4 years ago

into avahiclient.cpp, there is #include librairies that are not founded, such as : avahi-client/client.h, avahi-client/publish.h avahi-client/lookup.h. actually, there is no file named "avahi-client" in the downloaded file.

jbagg commented 4 years ago
  Build Dependencies

Qt5

On Linux, libavahi-client-dev and libavahi-common-dev

On 30/03/20 05:10 PM, jeremyczaicki wrote:

into avahiclient.cpp, there is #include librairies that are not founded, such as : avahi-client/client.h, avahi-client/publish.h avahi-client/lookup.h. actually, there is no file named "avahi-client" in the downloaded file.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jbagg/QtZeroConf/issues/32#issuecomment-606251445, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADFEL42PTUCK55POBU3FZ4TRKEDDXANCNFSM4LUSGGMA.

jeremyczaicki commented 4 years ago

Hi jbagg, have you found a solution ?

jbagg commented 4 years ago

Yes, please type git checkout c286fcd2c090b2b9bace0874b0e42e7084d15b4d

I tried to re-install El capitan on my companies macbook, but when I enter my apple id, it fails. (and I already erased the drive) I can login to the web, but not the installer. Good old apple quality! I've thought about buying a newer mac, but I think I would be throwing away my time and money. Apple just isn't friendly to developers (or anyone for that matter)

mincequi commented 4 years ago

Is there an Update on this issue? As mentioned before, i can test that for you.

jbagg commented 4 years ago

yes, this should be fixed in commit 9d7b114e6aba6ff6fc54259cd89fdc159c15c60b (July 8th, 2020). Please test.