Re: [iPhone] networking

2009-08-06 Thread James Lin
or across bridged sub-nets. To do service discovery across sub-nets would require a known DNS server publishing the existence of services and how to contact them via public IP addresses. Of course, in the context of the original question (re: iPhone networking), the iPhone is almost never going

Re: [iPhone] networking

2009-08-06 Thread James Lin
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

Re: [iPhone] networking

2009-08-06 Thread Keith Duncan
On 6 Aug 2009, at 09:13, Roland King wrote: I've never seen any. I assume that as well as multicast dns there are ways to configure bonjour to point to some central DNS server which would enable something like that to work Yes, you can use regular unicast DNS, and query a specified DNS

Re: [iPhone] networking

2009-08-06 Thread Keith Duncan
On 6 Aug 2009, at 09:27, James Lin wrote: [...] 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). [...] Is this my best option given what I want to accomplish? I'm afraid it isn't,

Re: [iPhone] networking

2009-08-06 Thread James Lin
Can you please elaborate a bit more? What technology option do I have when it comes to a messaging server? What's involved on the iPhone's side? Thank you in advance... James On 2009/8/6, at 下午 4:33, Keith Duncan wrote: On 6 Aug 2009, at 09:27, James Lin wrote: [...] keeps querrying the

Re: [iPhone] networking

2009-08-06 Thread Jeremy Pereira
On 6 Aug 2009, at 09:27, James Lin wrote: Is this my best option given what I want to accomplish? Thanks in advance... Stepping back a little bit. Are you trying to build some sort of real time messaging service? Or does it matter if the second phone doesn't receive the message

Re: [iPhone] networking

2009-08-06 Thread James Lin
well...I guess you can call it some sort of real time messaging service... I just need to send a string from iPhoneA to iPhoneB. And allow iPhoneB to reply with another string back to iPhoneA. That's all I am trying to do. I had no idea it is so difficult and involves so much. given my state

Re: [iPhone] networking

2009-08-05 Thread glenn andreas
to contact them via public IP addresses. Of course, in the context of the original question (re: iPhone networking), the iPhone is almost never going to have a public IP address (being hidden behind WiFi or cell phone NATs). Glenn Andreas gandr...@gandreas.com http

Re: [iPhone] networking

2009-08-05 Thread Kyle Sluder
On Aug 4, 2009, at 4:42 PM, Shawn Erickson wrote: Of course, in the context of the original question (re: iPhone networking), the iPhone is almost never going to have a public IP address (being hidden behind WiFi or cell phone NATs). Assuming cell carriers don't get off their butts

Re: [iPhone] networking

2009-08-05 Thread Kaelten
Just brainstorming theory here, but it might be made much easier if you had a server act as an intermediary, even if all that server does is 'introduce' the two iphones to each other. Bryan McLemore Kaelten On Tue, Aug 4, 2009 at 1:10 PM, James Linjamesclin...@gmail.com wrote: Correct me if I

[iPhone] networking-is it crippled on the simulator?

2009-08-04 Thread James Lin
Hi all, Does anyone know the limitation of the iPhone simulator when it comes to networking? Is it crippled on the simulator? I've tried two seperate ways of opening up a server socket. 1. is by opening up a CFSocket 2. is by a socket wrapper class called LXSocket class obtained from

Re: [iPhone] networking-is it crippled on the simulator?

2009-08-04 Thread John C. Randolph
On Aug 4, 2009, at 5:43 AM, James Lin wrote: Hi all, Does anyone know the limitation of the iPhone simulator when it comes to networking? Is it crippled on the simulator? I've tried two seperate ways of opening up a server socket. 1. is by opening up a CFSocket 2. is by a socket wrapper

Re: [iPhone] networking-is it crippled on the simulator?

2009-08-04 Thread James Lin
Safari works for me too... The reason I am asking this seemingly redundant question is simply : I don't have an iPhone yet (3GS won't be available in my country until end of Aug) and I am doing all my programming blind on the simulator. if networking is crippled on the simulator, that means

Re: [iPhone] networking-is it crippled on the simulator?

2009-08-04 Thread Roland King
it is not crippled On Aug 4, 2009, at 9:48 PM, James Lin wrote: Safari works for me too... The reason I am asking this seemingly redundant question is simply : I don't have an iPhone yet (3GS won't be available in my country until end of Aug) and I am doing all my programming blind on the

Re: [iPhone] networking-is it crippled on the simulator?

2009-08-04 Thread Luke the Hiesterman
Networking should work on the simulator. There are several networking related pieces of sample code that work on the simulator. http://developer.apple.com/iphone/library/navigation/SampleCode.html Luke On Aug 4, 2009, at 6:48 AM, James Lin wrote: Safari works for me too... The reason I am

Re: [iPhone] networking-is it crippled on the simulator?

2009-08-04 Thread Dave Camp
On Aug 4, 2009, at 5:43 AM, James Lin wrote: Hi all, Does anyone know the limitation of the iPhone simulator when it comes to networking? Is it crippled on the simulator? I've tried two seperate ways of opening up a server socket. By server socket, do you mean you are trying to connect

Re: [iPhone] networking

2009-08-04 Thread James Lin
I am trying to make the iPhone a server and a client at the same time... What I am trying to accomplish... 1. iPhone running my application opens a server socket and listens for incoming network connection from another iPhone running the same application. 2. The server socket has an ip

Re: [iPhone] networking

2009-08-04 Thread Luke the Hiesterman
Have you tried using CFHost to get your IP? Luke On Aug 4, 2009, at 10:49 AM, James Lin wrote: I am trying to make the iPhone a server and a client at the same time... What I am trying to accomplish... 1. iPhone running my application opens a server socket and listens for incoming

Re: [iPhone] networking

2009-08-04 Thread glenn andreas
On Aug 4, 2009, at 12:49 PM, James Lin wrote: I am trying to make the iPhone a server and a client at the same time... What I am trying to accomplish... 1. iPhone running my application opens a server socket and listens for incoming network connection from another iPhone running the same

Re: [iPhone] networking

2009-08-04 Thread James Lin
I am not using CFHost... I use the CFSocketCopyAddress() on a CFSocketRef (my server socket) called TCPServer. CFDataRef serverAddressData = CFSocketCopyAddress(TCPServer); NSString *serverAddressString; serverAddressString = [NSString stringWithFormat: @%@, [self

Re: [iPhone] networking

2009-08-04 Thread Luke the Hiesterman
It looks like you're asking for the IP address from a socket before you've given it an IP. As someone said earlier, you have to bind an IP address to a socket - it doesn't just come out of thin air. Luke On Aug 4, 2009, at 11:07 AM, James Lin wrote: I am not using CFHost... I use the

Re: [iPhone] networking

2009-08-04 Thread James Lin
Correct me if I am wrong...but from what i have read so far... Bonjour is for local area network, right? What I am trying to do is to get 2 iPhones located in 2 different part of the world to connect to each other on the internet. Can Bonjour work? Thanx in advance... James On 2009/8/5, at

Re: [iPhone] networking

2009-08-04 Thread James Lin
I did call CFSocketSetAddress in my socket setup code to bind an IP address to a socket before the above code asking for ip... Thanx in advance... James On 2009/8/5, at 上午 2:09, Luke the Hiesterman wrote: It looks like you're asking for the IP address from a socket before you've given it

Re: [iPhone] networking

2009-08-04 Thread Shawn Erickson
On Tue, Aug 4, 2009 at 11:13 AM, Luke the Hiestermanluket...@apple.com wrote: On Aug 4, 2009, at 11:10 AM, James Lin wrote: Bonjour is for local area network, right? No, Bonjour is applicable to any networking, local or wide area. Here's some sample code.