O'Reilly logo

iOS and OS X Network Programming Cookbook by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an echo server that uses Bonjour to advertise the service

Now that we know how to publish, find, and resolve a service, let's put it all together with an actual service to connect to. In this recipe, we will take the echo server that we created in Chapter 2, Apple Low-level Networking, and add the code to publish the service with Bonjour.

The downloadable code for this chapter contains an iOS application that uses both the CFSocketServer class (from Chapter 2, Apple Low-level Networking) and the BonjourPublishServices class (from this chapter). The application, once the user clicks on the Start button, will attempt to publish the service; however, the echo server will start when the application first starts up. Keep in mind that publishing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required