Re: [iPhone] networking
Re: [iPhone] networking
- Subject: Re: [iPhone] networking
- From: James Lin <email@hidden>
- Date: Thu, 6 Aug 2009 16:27:19 +0800
My goal:
1. 1 iPhone running my app working as a server waiting for
connection from another iPhone from the "internet".
2. Another iPhone running my app working as a client connects to
the server iPhone and send a string "hi, I am James".
3. The server iPhone, upon receiving this string reply with user's
choice of either String A or String B back to the client iPhone.
From the comment below...if an iPhone is never going to have a
public IP address...
How do I make 1 iPhone connect to another?
You basically can't, and people have been trying to tell you this
for some time now, most of the replies to your questions have said
exactly that, you can't network through NAT, phones don't have
public IP addresses, or they rarely do.
So, if I cannot make 2 iPhones talk to each other, but I have a php/
mysql server.
Can my other option be the following?
1. iPhone A post the message "Hi, I am James" to the php/mysql server
and specifies the message is for iPhone B.
2. iPhone B running my app keeps querrying the php/mysql server for
message left for it with a querry to php/mysql server inside a
NSTimer (say querry once every 30 seconds).
3. iPhone B, upon getting a result that there is a message from iPhone
B, do whatever it needs to do and post the reply back to the php/mysql
server.
4. iPhone A, inside a NSTimer, querrys the php/mysql server for result
of the original posting from B.
Is this my best option given what I want to accomplish?
Thanks in advance...
James
_______________________________________________
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