Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RossOliver

macrumors regular
Original poster
Nov 6, 2006
157
0
Does the iPhone have any capability to 'discover' one another when several iPhones are in range?

Just thinking about multilayer games and what not - I know the MacBooks can act as a wireless tansmitter as well as receiver; is this kind of thing possible with the iPhone? Maybe over Bluetooth?

-Ross
 
Does the iPhone have any capability to 'discover' one another when several iPhones are in range?

Just thinking about multilayer games and what not - I know the MacBooks can act as a wireless tansmitter as well as receiver; is this kind of thing possible with the iPhone? Maybe over Bluetooth?

-Ross

I believe iPhone OS has Bonjour, which is what MacOSX uses for discovery services.
 
I believe iPhone OS has Bonjour, which is what MacOSX uses for discovery services.

That sounds like it could be used by a program to provide multi-user services, but I think the phone still needs the ability to make a physical link to another device. From what I can tell bonjour only allows discovery of services once the connection has been established, but doesn't deal with making the connection itself...
 
I have no clue how Bonjour works programatically (i.e. what type of information is available to you when you broadcast), but if you can broadcast your IP & listening port then a nearby iPhone can just open a socket connection there and you can start your game.
 
There is an iPhone sample code project showing how to make a client/server "game" that was discoverable over wifi. Its called WiTap.
 
Aha, excellent - I'll delve into the WiTap source and take a closer look at Bonjour :)

Cheers

[edit]

Out of interest, how do you test networked applications? Can you run multiple iPhone Simulators somehow?
 
Aha, excellent - I'll delve into the WiTap source and take a closer look at Bonjour :)

Cheers

[edit]

Out of interest, how do you test networked applications? Can you run multiple iPhone Simulators somehow?

I shall have a look as well...:)

Maybe multiple simulators or simulator + real iPhone. At the very least, you won't need another iPhone just to test your networking code. You can have the server be on the mac itself. Would be nice too if you want to play your game between iPhone and Desktop.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.