jbagg / QtZeroConf

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

How to search for all kinds of services? #58

Open probonopd opened 1 year ago

probonopd commented 1 year ago

How to search for all kinds of services?

This works, but only finds one type of service:

zeroConf.startBrowser("_http._tcp");

This doesn't work:

zeroConf.startBrowser(nullptr);
zeroConf.startBrowser("");
zeroConf.startBrowser("*");
zeroConf.startBrowser("*._tcp");

So if I need to find any service on the network regardless of its type or protocol, how would I do that? And how would I find all services on TCP?

jbagg commented 1 year ago

This is not supported in any form. startBrowser() is for only one service type at a time.

probonopd commented 1 year ago

Thanks @jbagg. How hard would this be to implement?

jbagg commented 1 year ago

I don't know. I would suggest looking at avahi-discover. It is not a usual use case for ZeroConf as the app knows the service name it is looking for.

probonopd commented 1 year ago

Possibly something along the lines of _services._dns-sd._udp.local. - that's at least what https://github.com/nitroshare/qmdnsengine is using in their example to find all services.

This is what Apple says: https://developer.apple.com/library/archive/qa/qa1337/_index.html

Issuing a Multicast DNS PTR record query for the name _services._dns-sd._udp.local. will return a list of service types being advertised on the local network.