14Network Programming With Sockets

The native Mac OS X networking API is Berkeley sockets, variants of which are available on just about every platform available today. The sockets API is simultaneously elegant, needing just a couple of calls to set up network communications of different kinds, and ugly. The data structures involved are awkward because there are few typedefs, so you have to use the struct keyword frequently along with frequent casting.

One of the problems with networking in general, and sockets in particular, is that there is a lot of documentation and a lot of features of varying levels of complexity and obscurity. It is easy to get lost in the details and be unable to get the basics working. In this chapter, we are going to ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide 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.