Connecting to iPhone from PC
Hi All,
I'm working on an iPhone application for a school project and I'm a little stuck on connecting to the phone from a PC.
What I want to do is connect to the phone from a PC and send data back and forth. I am using BSD sockets on the iPhone end and I'm looking to bind to some port and accept connections from the computer (i.e. the iPhone is the server, the PC is the client).
Over Wifi, this works fine, but once I try to do it over 3G, the connection doesn't happen.
I am binding to the IP address that corresponds to the pdp_ip0 network interface (which I am pretty certain is the 3G one). bind() succeeds, listen() succeeds, but when I try to connect from another computer, the connection is never accepted (although accept(), on the iPhone side, doesn't fail with an error). I'm wondering if this is a networking issue - is the IP from pdp_ip0 "visible" to the outside world? Do 3G networks do NAT? I hope I'm asking the right questions...
Once again, IF I connect the phone and the PC to the same WiFi network, the connection is accepted and everything carries on as expected... so I'm pretty sure it's not a programming error...
Thanks for any advice you may have
|