Book Image

iOS and OS X Network Programming Cookbook

By : Jon Hoffman
Book Image

iOS and OS X Network Programming Cookbook

By: Jon Hoffman

Overview of this book

Table of Contents (15 chapters)
iOS and OS X Network Programming Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


The primary API behind Apple's low-level networking is the CFNetwork API.

The simplest way to describe CFNetworking is to say that it is an Apple-specific extension to the BSD socket API. The CFNetworking stack is based on and relies on the BSD socket API that was discussed in Chapter 1, BSD Socket Library. It is recommended that the reader understands the concepts discussed in Chapter 1, BSD Socket Library, prior to going through this chapter. While this chapter will focus primarily on CFNetworking for most of the recipes, we will also use NSHost and the system configuration framework for retrieving network address information and checking the network status recipes. The biggest advantage that BSD sockets have over CFNetwork is the compatibility with other forms of Unix. This is a pretty big advantage when you think of all the BSD socket code on the Internet that you can use. However, if your application is Apple-specific, it is recommended that you use CFNetwork wherever you...