-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Scan for all the mDNS devices in the network #86
Comments
I did some researches with what you've provided. Why don't you do something like that ? BonsoirDiscovery typeDiscovery = BonsoirDiscovery(type: '_services._dns-sd._udp');
await typeDiscovery.ready;
Map<String, BonsoirDiscovery> discoveries = {};
discovery.eventStream!.listen((event) async {
if (event.type == BonsoirDiscoveryEventType.discoveryServiceFound) {
String type = event.service!.type;
BonsoirDiscovery discovery = BonsoirDiscovery(type: type);
await discovery.ready;
discoveries[type] = discovery;
} else if (event.type == BonsoirDiscoveryEventType.discoveryServiceLost) {
await discoveries[type]?.stop();
discoveries.remove(type);
}
});
await discovery.start(); |
Hi @Skyost I am tying to do something similar but with http._tcp. if I use either http._tcp. or _services._dns-sd._udp I get the following error:
|
@MaxiStefan Do you mean |
Hi, Because of the
So we need to account for the special meta-query in this function. |
Hi, I'm back after some tests. It looks like the solution doesn't only require adding a specific rule to the |
That's not an error, just a warning. |
Hi again, sorry for late reply. I've been doing some experimenting and finally got it to work (for linux at least). The only thing is that this special case might need to be documented as it is a bit different from normal services. '${event.service!.name}.${event.service!.type}' // _http._tcp It's still pretty usable, especially for such a niche use case but it could be nice to have specific wrapper for it. If you're okay with this @Skyost I'll open a PR as soon as possible. |
Is your feature request related to a problem? Please describe.
I would like to scan all mDNS devices in the network in an efficient manner.
I saw that there is an option to search for a specific serviceType but I prefer not to search all the serviceTypes that ever existed.
Describe the solution you'd like
As written in DNS-SD specification chapter 9 there is a special type
_services._dns-sd._udp
that retrieves all current types in the network.I would love to see a function that retrieves all of the serviceType on the network using _services._dns-sd._udp so that I can iterate only on existing services in the network.
Describe alternatives you've considered
I have searched also in multicast_dns but they do not support it yet, see issue number 97210 on flutter repo https://github.com/flutter/flutter/issues
Also nsd package had implemented it in issue number 8 https://github.com/sebastianhaberey/nsd/issues/ .
This package is more popular, supports Linux, I think the other package does not support iOS (issue 57) so it would be easier for me if it exists here.
The text was updated successfully, but these errors were encountered: