Publishing a Bonjour service
Bonjour allows for the discovery of network devices and services on an IP network without a centralized server. In this recipe, we will create a class called BonjourPublishServices
that will contain the code needed to publish a service with NSNetService
.
The NSNetService
class is normally used to publish information about a socket server. While it is also typical for NSNetService
and the socket server to be running within the same application, it is not a requirement since NSNetService
does not use, nor is it dependent on the socket server in any way.
As the publication of the service may not happen instantaneously, NSNetService
should publish the request asynchronously. NSNetService
uses delegate methods to handle the ...
Get iOS and OS X Network Programming Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.