iOS 7's Multipeer Connectivity | An API For Offline Nearby iOS Devices


Multipeer Connectivity is a framework that enables nearby devices to communicate over infrastructure Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks. Connected peers are able securely transmit messages, streams, or file resources to other devices, to chat and share photos even without an Internet connection or when they are far beyond WiFi and Bluetooth range from each other connected with a chain of peer-to-peer users between one user and a far-away Internet connection.


Advertising & Discovering:
The first step in communication is to make peers aware of one another. This is accomplished by advertising and discovering services.


Advertising makes a service known to other peers, while discovery is the inverse process of the client being made aware of services advertised by other peers. In many cases, clients both discover and advertise for the same service, which can lead to some initial confusion—especially to anyone rooted in the client-server paradigm.

Each service is identified by a type, which is a short text string of ASCII letters, numbers, and dashes, up to 15 characters in length. By convention, a service name should begin with the app name, followed by a dash and a unique descriptor for that service.


Sending & Receiving Information:
Once peers are connected to one another, information can be sent between them. The Multipeer Connectivity framework distinguishes between three different forms of data transfer:

1. Messages are information with well-defined boundaries, such as short text or small serialized objects.
2. Streams are open channels of information used to continuously transfer data like audio, video, or real-time sensor events.
3. Resources are files like images, movies, or documents

Comments

Popular Posts