Reputation: 8735
all is in the question..
I would know how to create a connection between an iPad/iPhone(sender) and a lot of others devices iPad/iPhone (listeners). The chalenge is : I have to create this without using any intermediate server.
Each devices listeners should respond 'in live' to each sender message.
Any suggestion how to achieve this ?
Upvotes: 0
Views: 348
Reputation: 6545
Have a look at Peer-to-Peer connectivity via Bluetooth (this is part of the GameKit API in iOS).
Upvotes: 0
Reputation: 64700
Basically you need multicast DNS (Apple calls it Bonjour). See http://developer.apple.com/opensource/ for the start of Apple's documentation, and see http://mobileorchard.com/tutorial-networking-and-bonjour-on-iphone/ for a nice writeup.
Upvotes: 1
Reputation: 73071
If all the devices are on the same LAN, you can just have them discover each other using broadcast or multicast UDP, and then (once they know each other's IP addresses) communicate with each other directly either via UDP or TCP. (of course, the number of direct TCP connections required increases very quickly with the number of devices, so that will only scale to certain extent. UDP could scale further, since it doesn't require a connection to be set up between every pair of devices).
The real problem is if (as is likely) the devices are at various places on the Internet, and some or all of them are behind NATs and firewalls. In that case, about the only thing you can rely on is the devices' ability to make an outgoing TCP connection, in which case you almost require a server for them to connect to, because they won't be able to connect directly to each other in most cases (that NATs/firewalls will filter out the incoming TCP connection packets for security reasons).
Upvotes: 0
Reputation: 1046
Use the Bonjour framework. The devices will have to be on the same subnet, but you are able to connect them without the use of a server. Apple provides some good sample code for the Bonjour framework. I have not released an app using Bonjour, but I have done a few development/proof-of-concept apps with Bonjour.
Upvotes: 1