I need to write a simple ping method in Cocoa/Objective-C. It also needs to work on the iPhone.
I found an example that uses icmp, will this work on the iPhone?
I’m leaning towards a solution using NSNetServices, is this a good idea?
The method only needs to ping a few times and return the average and -1 if the host is down or unreachable.
The code below seems to be working synchronously:
Note:
SystemConfiguration.frameworkis required