Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Ping or check if server of particular IP Address is available/connected in iPhone

Tags:

I want to Ping or Lookup a particular IP address of server if it is connected or available at that particular time or not in my iPhone application.

I searched a lot over internet but could not find any relevant result for same.

Please help me as I am new to this field.

Thanks in advance.

like image 797
P.J Avatar asked Nov 15 '11 07:11

P.J


People also ask

How do I ping an IP address in iOS?

Type ping. Hit the space bar. Then type in the IP address you want to check. Hit Enter.

Can you do a ping test on iPhone?

You can also use Pingify to test your iPhone's Wi-Fi or cellular signal strength, starting a ping and walking around an area. You might notice that some areas of your home, workplace, or anywhere else have a worse signal.


1 Answers

Apple provides reachability classes you can use the class and

You can download reachability.h and Reachability.m

And use this as

Reachability* reachability = [[Reachability reachabilityWithHostName: @"www.apple.com"] retain]; NetworkStatus netStatus = [reachability currentReachabilityStatus]; 

netStatus gives the reachabilty of the server.

like image 181
nswamy Avatar answered Nov 10 '22 16:11

nswamy