Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-16-2010, 05:56 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 20
Avocado is on a distinguished road
Default 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
Avocado is offline   Reply With Quote
Reply

Bookmarks

Tags
bsd, connect, nat, server

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 351
11 members and 340 guests
akacaj, c2matrix, cgokey, esoteric, givensur, HemiMG, Mirotion22, mjnafjke, Pudding, SLIC, Techgirl-52
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,651
Threads: 94,115
Posts: 402,887
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Mirotion22
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:15 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0