I am implementing network reachability in my iOS app. My server has a class C ip address 192.168.x.x.
When both wifi an 3G are turn on my device. The reachability flags tells me that the destination is reachable via wifi.
When i turn wifi off on the device but keep 3G on, the network reachability flags tell me that the destination is reachable via mobile as well.
My understanding is that this is not possible as my server is not publicly avialable on the internet.
Is it possible the gateway for the mobile service provider has a server internally with that IP, or it is somehow always falsely saying that the IP address is reachable. I am on the O2 network in the UK.
Just incase it was a problem with my app I also got the same result with the apple example application
The system doesn't know if you can connect to a particular IP (without actually connecting to it and succeed/fail). It knows whether your devices have a network connectivity or not.
If you are connected to the internet you can establish connections to any IP addresses, even in private range. The fact that such a connection will likely fail is another thing.
A remote host is considered reachable when a data packet, sent by an application into the network stack, can leave the local device.