0
votes

I am facing a issue on network reachability.

I have used the reachability class provided by apple and have done all necessary steps to get the host reachability.

It works fine for any valid site eg.:

  • www.apple.com
  • www.google.com
  • etc.

For all these sites i used to get the host reachability response as reachable, but when I give a specific IP(eg: http://196.12.125.34/) which is required by me to check for the hostReachability it gives negative response i.e notReachable.

Can anyone suggest what may be the issue?

1

1 Answers

2
votes

You need to use a different method on Reachability for IP Address:

For host name:

//reachabilityWithHostName- Use to check the reachability of a particular host name. 
+ (Reachability*) reachabilityWithHostName: (NSString*) hostName;

For IP Address:

//reachabilityWithAddress- Use to check the reachability of a particular IP address. 
+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;