iphone - works - socket programming in objective c example

Is it possible to connect two ios devices using sockets by getting their IP addressess? (4)

I want to connect multiple devices through socket without any server implementation.I will use that only for getting the IP addresses of the devices that will register.

Building a Jabber Client for iOS: XMPP Setup

here is link

I've been working on something similar and it's a giant pain in the ass. There are 3 considerations: 1) Reachability 2) Discovery 3) The connection itself.

1) Don't even consider using 3g/4g, it just won't work well for keeping an open socket connection.

2) I'd use some sort of broker service between the two on the internet to connect the two. For discovery, you can just list what devices are available on the service.

3) For the connection, I find the IOS socket libraries to be rather painful to use, but if you go down to the BSD socket level it's not as bad. I think it'd be very interesting to use zmq sockets; that might simplify writing the broker service.

You can use GameKit. It has the matchmaking api that can help you.

It can be used for non game apps.

You can't. If the device is all online with wifi, it maybe possible and rely on the router setting just like pc connect. If some device is connected with 3g or gprs protocal , they may have no ip address at all.