iOS and OS X Network Programming Cookbook

If you want to develop network applications for iOS and OS X, this is one of the few books written specifically for those systems. With over 50 recipes and in-depth explanations, it’s an essential guide.
Preview in Mapt

iOS and OS X Network Programming Cookbook

Jon Hoffman

1 customer reviews
If you want to develop network applications for iOS and OS X, this is one of the few books written specifically for those systems. With over 50 recipes and in-depth explanations, it’s an essential guide.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$21.00
RRP $29.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$21.00
$49.99
$29.99 p/m after trial
RRP $29.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


iOS and OS X Network Programming Cookbook Book Cover
iOS and OS X Network Programming Cookbook
$ 29.99
$ 21.00
iOS 11 Programming with SWIFT [Video] Book Cover
iOS 11 Programming with SWIFT [Video]
$ 124.99
$ 106.25
Buy 2 for $35.00
Save $119.98
Add to Cart

Book Details

ISBN 139781849698085
Paperback300 pages

Book Description

Darwin, which forms the core set of components for OS X and iOS, is compatible with the Single UNIX Specification Version 3 and POSIX UNIX. Therefore OS X and iOS are UNIX operating systems. While there are numerous books and articles written to teach network development in a UNIX environment there is surprisingly little dedicated to teaching network development specifically in an Apple environment. In this book we will be covering the standard UNIX networking stack with BSD Sockets as well as Apple’s frameworks like CFNetworking and Bonjour.

"iOS and OS X Network Programming Cookbook" is an enthralling code-focused book on developing client and server applications for the iOS and OS X environments. You will learn how to integrate a number of Unix (BSD Sockets), Apple specific (CFNetworking, NSMutableURLRequest, Bonjour) and third party APIs (AFNetworking, MKNetworking) with your own apps.

"iOS and OS X Network Programming Cookbook" begins by showing you how to build both client and server applications using the BSD Socket Library as well as Apple’s CFNetworking library. The sample code includes samples for both iOS and OS X.

It then covers how to add Bonjour to publish, find, and connect to services. This can be used to create peer-to-peer applications over local networks. Finally it shows how to integrate third-party libraries like Libnet, LibPCAP, AFNetworking, and MKNetworking with the reader’s apps.

A lot of developers do not realize that iOS is a full UNIX-based operating system that contains a full set of networking APIs. These APIs can be used to create both client- and server-based applications in the iOS environment as well as OS X. Using the Apple’s Bonjour library you will learn how to publish, find, and connect the services together without hardcoding the connection information. There are also a number of third-party APIs that can be used to easily connect iOS and OS X applications to web-based services. Finally this book will cover several low level libraries like LibNET and LibPCAP on the OS X environment.

"iOS and OS X Network Programming Cookbook" will cover several UNIX, Apple, and third-party libraries and APIs. The book will show the user how to integrate all of these libraries and APIs with their applications.

Table of Contents

Chapter 1: BSD Socket Library
Introduction
Finding the byte order of your device
Retrieving network address information
Performing a network address resolution
Creating an echo server
Creating an echo client
Creating a data server
Creating a data client
Chapter 2: Apple Low-level Networking
Introduction
Retrieving network address information
Performing a network address resolution
Creating an echo server
Creating an echo client
Creating a server to receive data
Creating a client to send data
Checking the network status
Chapter 3: Using Libnet
Introduction
Installing libnet
Adding libnet to your project
Resolving names to addresses with libnet
Retrieving local addresses with libnet
Constructing a Ping packet with libnet
Constructing a UDP packet with libnet
Constructing a TCP packet with libnet
Chapter 4: Using Libpcap
Introduction
Adding libpcap to your project
Retrieving network device information
Capturing packets
Decoding Ethernet headers
Decoding IP headers
Decoding ARP headers
Decoding TCP headers
Decoding UDP headers
Decoding ICMP headers
Filtering packets
Saving a capture file
Creating a simple port scanner using libnet and libpcap together
Chapter 5: Apple High-level Networking
Introduction
Performing HTTP(S) synchronous GET requests
Performing HTTP(S) synchronous POST requests
Performing HTTP(S) asynchronous GET requests
Performing HTTP(S) asynchronous POST requests
Parsing an RSS feed with NSXMLParser, NSURL, and NSData
Creating a peer-to-peer bluetooth network
Chapter 6: Bonjour
Introduction
Publishing a Bonjour service
Discovering a Bonjour service
Resolving a Bonjour service
Creating an echo server that uses Bonjour to advertise the service
Creating an echo client that uses Bonjour to discover the service
Chapter 7: AFNetworking 2.0 Library
Introduction
Checking the network connection type and changes
Creating a web client using AFHTTPSessionManager
Creating a custom response serializer
Using the UIImageView+AFNetworking category
Downloading files with a progress bar
Chapter 8: MKNetworkKit
Introduction
Creating and using the MKNetworkKit engine
Uploading a file using MKNetworkKit
Downloading a file using MKNetworkKit
Using the UIImageView+MKNetworkKitAdditions.h category and caching the images
Adding a progress bar to upload or download

What You Will Learn

  • Create client- and server-based applications with the BSD socket API
  • Create client- and server-based applications with CFNetworking
  • Publish, find, and connect client applications with servers using Apple’s Bonjour library
  • Use the AFNetworking library to connect to web-based services
  • Connect to web-based services using the MKNetworking library
  • Explore the LibNET packet construction library in OS X
  • Get to grips with the LibPCAP packet capture library in OS X
  • Discover Apple’s high-level APIs to connect to devices via Bluetooth
  • Connect two devices with a Bluetooth connection

Authors

Table of Contents

Chapter 1: BSD Socket Library
Introduction
Finding the byte order of your device
Retrieving network address information
Performing a network address resolution
Creating an echo server
Creating an echo client
Creating a data server
Creating a data client
Chapter 2: Apple Low-level Networking
Introduction
Retrieving network address information
Performing a network address resolution
Creating an echo server
Creating an echo client
Creating a server to receive data
Creating a client to send data
Checking the network status
Chapter 3: Using Libnet
Introduction
Installing libnet
Adding libnet to your project
Resolving names to addresses with libnet
Retrieving local addresses with libnet
Constructing a Ping packet with libnet
Constructing a UDP packet with libnet
Constructing a TCP packet with libnet
Chapter 4: Using Libpcap
Introduction
Adding libpcap to your project
Retrieving network device information
Capturing packets
Decoding Ethernet headers
Decoding IP headers
Decoding ARP headers
Decoding TCP headers
Decoding UDP headers
Decoding ICMP headers
Filtering packets
Saving a capture file
Creating a simple port scanner using libnet and libpcap together
Chapter 5: Apple High-level Networking
Introduction
Performing HTTP(S) synchronous GET requests
Performing HTTP(S) synchronous POST requests
Performing HTTP(S) asynchronous GET requests
Performing HTTP(S) asynchronous POST requests
Parsing an RSS feed with NSXMLParser, NSURL, and NSData
Creating a peer-to-peer bluetooth network
Chapter 6: Bonjour
Introduction
Publishing a Bonjour service
Discovering a Bonjour service
Resolving a Bonjour service
Creating an echo server that uses Bonjour to advertise the service
Creating an echo client that uses Bonjour to discover the service
Chapter 7: AFNetworking 2.0 Library
Introduction
Checking the network connection type and changes
Creating a web client using AFHTTPSessionManager
Creating a custom response serializer
Using the UIImageView+AFNetworking category
Downloading files with a progress bar
Chapter 8: MKNetworkKit
Introduction
Creating and using the MKNetworkKit engine
Uploading a file using MKNetworkKit
Downloading a file using MKNetworkKit
Using the UIImageView+MKNetworkKitAdditions.h category and caching the images
Adding a progress bar to upload or download

Book Details

ISBN 139781849698085
Paperback300 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Software Defined Networking with OpenFlow Book Cover
Software Defined Networking with OpenFlow
$ 23.99
$ 16.80
Learning Android Google Maps Book Cover
Learning Android Google Maps
$ 39.99
$ 28.00
Managing and Customizing OpenCms 6 Websites Book Cover
Managing and Customizing OpenCms 6 Websites
$ 23.99
$ 16.80
SDL Trados Studio - A Practical Guide Book Cover
SDL Trados Studio - A Practical Guide
$ 13.99
$ 9.80
Mastering TypoScript: TYPO3 Website, Template, and Extension Development Book Cover
Mastering TypoScript: TYPO3 Website, Template, and Extension Development
$ 35.99
$ 25.20
Building Websites with Mambo Book Cover
Building Websites with Mambo
$ 23.99
$ 16.80