How to get the list of all announced bonjour services on all available domains?

前端 未结 2 477
南笙
南笙 2021-02-03 09:56

It\'s not the problem to look in all domains, but I can\'t find the right way to look for any service on the network.

2条回答
  •  别那么骄傲
    2021-02-03 10:37

    Old thread but there is a way to find the local services Discovering all advertised Bonjour service types. You will need to do some manipulation of the results to get the types in the correct format. This works on Mac & iPhone although no services are discovered if I haven't got a Wifi connection on iPhone.

        NSNetServiceBrowser* domainBrowser = [[NSNetServiceBrowser alloc] init];
        domainBrowser.delegate = self;
        [domainBrowser searchForServicesOfType:@"_services._dns-sd._udp."
                                  inDomain:@"local."];
    

提交回复
热议问题