I have requirement like, One iPhone Device acts as a server and several iPhone devices acts as a clients.I have to communicate the client devices to the Server Device over Wifi. How Can I achieve this. It would be appreciated if Could you provide any tutorial. Thanks in Advance..
-
Possible duplicate of http://stackoverflow.com/a/8116004/352891 – user352891 May 01 '13 at 12:46
4 Answers
!!! NOTE:
Below answer suggests an API that has been deprecated since iOS 7.
you are looking at GKSession.. and this is an excellent and comprehensive tutorial for what you're looking for. IF you wanna dive a little deeper take a look at this project I made.
the link in the comment above uses bonjour, which is a layer below GKSession (ie GKSession is a wrapper for bonjour).. so depending on how many devices you want to connect at a time (GKSession starts choking around 3-4) and how extensive your throughput/ping requirements are, you'd chose one or the other.

- 8,465
- 6
- 41
- 47

- 23,101
- 16
- 132
- 246
Please look at following links these may be useful to you

- 1
- 1

- 2,126
- 3
- 21
- 33
Take a look at the Game Kit class. Game Kit provides classes that implement the low-level networking infrastructure to allow the devices to exchange data in real time.

- 11,636
- 4
- 39
- 55
If anyone is reading this in/after 2018, the current approach is:
MultipeerConnectivity
Docs:
MultipeerConnectivity
https://developer.apple.com/documentation/multipeerconnectivity
Cross Platform Nearby Networking
https://developer.apple.com/videos/play/wwdc2014/709/
(GKSession
has been deprecated since iOS 7)

- 8,465
- 6
- 41
- 47