• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [iPhone] Network connection between 2 iPhones
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iPhone] Network connection between 2 iPhones


  • Subject: Re: [iPhone] Network connection between 2 iPhones
  • From: glenn andreas <email@hidden>
  • Date: Mon, 13 Jul 2009 11:40:19 -0500


On Jul 13, 2009, at 11:22 AM, James Lin wrote:

the usage scenario...

I want my app to obtain another iPhone(also running my app)'s IP address from a server.
After that, my app on my iPhone can send data to the other iPhone.
This means my app on another iPhone has to be waiting for this network traffic to arrive.


How can this be done?

In general, this will only work if the two phones are on the same local network (such as on the wifi). If that's the case, you can just use Bonjour for discovery and not even need a remote server.


Otherwise, for example, if the two devices are using 3G to connect to the internet, even if they are set up to accept connections, the cell network NAT will disallow incoming connections. More complicated approaches (google "tcp hole punching" or "NAT Traversal") are needed for that (and I'm not sure that those techniques will work across cell networks).

You can, however, have both devices connect to the same remote server, and have it forward packets between them, but that approach does not scale well.

You're really going to have to do some more research on networking and peer-to-peer connections to understand the ramifications of trying to have one random device talk to another random device.

Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures, fractals, art



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >[iPhone] Network connection between 2 iPhones (From: James Lin <email@hidden>)
 >Re: [iPhone] Network connection between 2 iPhones (From: "I. Savant" <email@hidden>)
 >Re: [iPhone] Network connection between 2 iPhones (From: Roland King <email@hidden>)
 >Re: [iPhone] Network connection between 2 iPhones (From: James Lin <email@hidden>)

  • Prev by Date: Re: [iPhone] Network connection between 2 iPhones
  • Next by Date: Re: [iPhone] Network connection between 2 iPhones
  • Previous by thread: Re: [iPhone] Network connection between 2 iPhones
  • Next by thread: Re: [iPhone] Network connection between 2 iPhones
  • Index(es):
    • Date
    • Thread