Chapter 15. Peer-to-peer connections using Game Kit
This chapter covers
- Overview of Game Kit
- Creating peer-to-peer applications using the peer picker
- Building a multiplayer game
Networking has always been a complicated task in any programming language. It normally requires intimate knowledge of sockets, as well as a solid understanding of various network protocols such as TCP/IP and UDP. Apple has simplified this process with the release of the Game Kit framework.
In this chapter, we’ll take a tour of the Game Kit framework. Then, we’ll examine how to create peer-to-peer applications and a simple multiplayer game.
Game Kit is a framework that provides some simple yet powerful classes for accomplishing various networking tasks. These classes are built on top of the Bonjour protocol and do much of the heavy lifting needed for peer-to-peer interaction. Prior to iPhone OS 3.0, peer-to-peer interaction was used in few applications, because creating and managing network connections was complex. You needed specific knowledge of a network protocol such as Bonjour or TCP/IP in order to do any real-time multiplayer interaction. That all changed with the release of the Game Kit framework.