I'm developing an iPhone app that uses the network. The iPhone communicate with my server via HTTP request and should work on WiFi and 3G.
I currently use NSURLConnection initWithRequest
to send async requests to my server and get responses (but I will soon move to work with ASIHTTPRequest
library)
One thing that I'm not sure about is,
What happens when user device goes from WiFi to 3G (or vice versa)?
I know that the same connection can't be used and new connection must be established.
But do I need to do something to handle this situation, or does NSURLConnection
handle it automatically?
For example if I sent a request and in the middle of getting the response the connection changes, what will happen with this request?
I saw Apple's Reachability example code, and I know I can use Reachability to detect network changes, but not sure how to handle those changes.