I am trying to check reachability status for my server using following code:
struct sockaddr_in address;
address.sin_len = sizeof(address);
address.sin_family = AF_INET;
address.sin_port = htons(80);
address.sin_addr.s_addr = inet_addr("172.21.38.120");
Reachability *hostReachable = [Reachability reachabilityWithAddress:&address];
[hostReachable startNotifier];
and then checking the host status, but it is always giving status as NotReachable. I tried to check whether the server is reachable from terminal using following command:
telnet Hostname port
and Terminal is displaying the status as connected. Is there something that i am doing wrong? Thanks in advance.