Slee
Slee

Reputation: 28278

several iPads talking to a single main iPad?

I need to develop an app where several ipads communicate to a single main iPad. Would this be done using Bonjour or Game Kit? I looked at Bluetooth but that seems like a 1 to 1 communication. I have never messed with either of these API's

Upvotes: 0

Views: 207

Answers (3)

Christoph
Christoph

Reputation: 2073

WebSockets are the way to go. I would suggest learning about the basics of sockets, there are implementation in most programming languages. This helped me a lot: http://beej.us/guide/bgnet/ After getting a understanding of what sockets are and what they do u could use the CocoaAsyncSocket-Framework http://code.google.com/p/cocoaasyncsocket/ on iOS. It adds an additional level of abstraction to sockets that helps especially with non-blocking network communication. There is some sample code available.

Upvotes: 0

Design by Adrian
Design by Adrian

Reputation: 2235

Like Glycerin said earlier, take a look at WebSockets. You can choose to have one-to-one, one-to-many, many-to-many connections, and is insanely fast.

Here's a tutorial on Nettuts

Upvotes: 0

Jonathan Ellis
Jonathan Ellis

Reputation: 5479

You could use Bonjour to do this -- but remember that Bonjour is only a framework to advertise services and doesn't do any of the actual connection itself.

For Bonjour, you need to create an NSNetServicesBrowser to scan the network (which can use Bluetooth -- or WiFi) and publish an NTNetService with the port for the other iPads to connect to (this could be the "master" iPad itself).

Then you would need to run a server on the "master" iPad (that is advertising the service) and then have some sockets code to handle all of that. (For which I recommend AsyncSocket (http://code.google.com/p/cocoaasyncsocket/).

Let me know if this is something you would be interested in doing, and I would be able to provide some code snippets as a starting point...

Upvotes: 1

Related Questions