Network support

Hi,

Considering the new async http, has anyone got code or a library for finding other iOS devices on the local (eg: local wifi router) network?

It would be great to have a function which simply returns a list of all the nearby iOS devices - or the list of local devices running the same game.

I imagine the code would:

Perform search of local IPs
Attempt a connection on a specific port for a specific web page or (other) service
Make a request for registration for pairing and associated IDs
Return collection of IPs found at each address which had a reasonable response

If anyone knows how to do the first part, I’m quite prepared to finish the rest. I just think that having to connect to a public server to do it is flaking out - Flight Control has this local connection behaviour on bluetooth and wifi and does not need a public server.

My problem is that I don’t know the first thing about discovering local addresses. Can anyone tell me if it would be as simple/long-winded as taking the device’s IP and running through all the possible combinations for the last IP part or is it easier than that?

Sorry for rambling,

Matt. [import]uid: 8271 topic_id: 5865 reply_id: 305865[/import]

You could do this the brute force way, but please don’t do that. Network administrators will hate you.

The correct way to do this is using Zeroconf (Apple’s implementation is known as Bonjour). Unfortunately, this is not available yet through Corona.
[import]uid: 7563 topic_id: 5865 reply_id: 20330[/import]

Thanks @ewing, but how would you suggest doing it without Bonjour? There are, of course, apps which do it all the time - Flight Control for one.

I’d just love to put a simple to use library together for devs to do this…

m [import]uid: 8271 topic_id: 5865 reply_id: 20333[/import]

Client-server model. All devices connect to a public server with a well known routable IP address.

But for local, peer-to-peer, Zeroconf is the answer.

[import]uid: 7563 topic_id: 5865 reply_id: 20335[/import]