I'm using CFStreamCreatePairWithSocketToHost to create a socket connection between my server and the iPhone. However, I am finding that this only works with localhost, not with a public ip address or URL.
If I run my application in the iOS simulator with the host set to localhost, I am able to connect fine. However, if I use my actual iPhone to run the application and set the host as my server's IP address, it doesn't work. The app pretty much freezes for a minute and then finally tells me that it couldn't connect to the host.
Could anyone offer some tips as to how to solve this problem?