-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to query? #99
Comments
I got it working but I am not really sure if its a good idea to restart the process all the time ...
after it resolves i just restart it |
I think you might be having trouble with DNS caching. MDNS is useful for broad service discovery but it is not reliable for near-real-time device detection because most devices that deal with DNS will cache results for some amount of time. This behaviour is present in most operating systems, and some hardware like routers and gateways. Back when I was working on an app for a lighting controller we would frequently have many devices coming online, rebooting, going offline. Since our router cached DNS records, and Android cached DNS records, our app would see all of the recent devices as "active" even though some were powered off. I never figured out how long those records were cached for, nor what part of the Android OS was responsible for caching DNS. Our solution was to scan for devices, then show a "connecting..." dialog when a device was selected. The app would try to connect and would show an error if the IP address was unresponsive. You might try doing something similar! Your solution looks like it might be force-clearing the OS MDNS record cache by restarting the listener. I'm not sure how this interfaces at the OS level and what process costs are associated. It's probably a bad idea to The |
Okay, I've followed a similar thing that you are suggesting. |
@emcniece It also happens a lot that Something gets added but never resolved... |
Hi.
I understand and can use the library I think, but I don't understand how to do basic things.
I can subscribe or watch something but I can never really be sure if the device is still available on that address.
But after this nothing changes anymore. Even if i disconnect the device providing the mDNS service it's not detected.
What I need is to query "is this thing right now in this network available" but I am not sure if this plugin can do that.
If yes, how can i do this ?
The text was updated successfully, but these errors were encountered: