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

前端 未结 2 485
南笙
南笙 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:29

    To my knowledge, there's not a function that will search for all available services. The reason is probably because an application publishing a service can define its own service type.

    If you are only looking for services of common types (HTTP, printer, etc) you can easily create a loop to call -[instanceOfNSNetServiceBrowser searchForServicesOfType:inDomain:] with all the types you want, in all the domains you previously discovered.

    The developer docs guide section on setting up a NSNetService can also be of aid.

提交回复
热议问题