Skip to Content
Zero Configuration Networking: The Definitive Guide
book

Zero Configuration Networking: The Definitive Guide

by Daniel H Steinberg, Stuart Cheshire
December 2005
Intermediate to advanced
252 pages
8h 55m
English
O'Reilly Media, Inc.
Content preview from Zero Configuration Networking: The Definitive Guide

Chapter 9. Using the CFNetwork and Cocoa APIs

In the previous three chapters, you have learned about techniques and APIs that work on multiple platforms. In Chapter 6, we covered the general concepts and the dns-sd command-line tool, which apply to all the supported platforms. In Chapter 7 we covered the DNSServiceDiscovery C API, which is available on all the supported platforms. In Chapter 8, you saw the Java API, which lets you write a Java program that will run on any supported platform with Java installed.

If you’re writing a program in C that’s built around a Core Foundation CFRunLoop as its central event-handling mechanism, or a program in Objective-C that’s built around a Cocoa RunLoop as its central event-handling mechanism, you have two options. The first option is that you can use the standard C DNSServiceDiscovery API and add those active operations as event sources to your RunLoop, as shown in the Core Foundation and Cocoa examples toward the end of Chapter 7. If you’re comfortable mixing standard C in with your Core Foundation-style or Cocoa-style programming, this is fine. However, if you prefer to stick to a single programming style, then you have a second option: Apple has provided additional wrapper APIs that follow the Core Foundation and Cocoa idioms.

In this chapter, you will look at how to perform the basic DNS-SD operations of registering a service, browsing for services, and resolving a service using these Mac OS X-specific APIs, which Apple has provided for ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Zero Trust Networks

Zero Trust Networks

Evan Gilman, Doug Barth
Understanding and Troubleshooting Cisco Catalyst 9800 Series Wireless Controllers

Understanding and Troubleshooting Cisco Catalyst 9800 Series Wireless Controllers

Nicolas Darchis, Simone Arena, Francisco Sedano Crippa, Sudha Katgeri
SSH, The Secure Shell: The Definitive Guide, 2nd Edition

SSH, The Secure Shell: The Definitive Guide, 2nd Edition

Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes

Publisher Resources

ISBN: 0596101007Errata Page