You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 1, 2024. It is now read-only.
Easy-to-use ICMP ping for iOS - just create a CDZPinger and you delegate gets a callback every second with the average ping time.
Installation
Add the dependency to your Podfile:
platform:iospod'CDZPinger'
...
Run pod install to install the dependencies.
Usage
#import "CDZPinger.h" and:
CDZPinger *pinger = [[CDZPinger alloc] initWithHost:@"google.com"];
// keep a strong reference to pinger, maybe in a property somewhere
pinger.delegate = self;
// (assuming self is your CDZPingerDelegate)
In your delegate:
#pragma mark CDZPingerDelegate
- (void)pinger:(CDZPinger *)pinger didUpdateWithAverageSeconds:(NSTimeInterval)seconds
{
NSLog([NSStringstringWithFormat:@"Received ping; average time %.f ms", seconds*1000]);
}
Requirements
CDZPinger requires iOS 5.x+. It might work on iOS 4, but I haven't tested it.
There's also some chance it'll work on OS X, but again, I haven't tested it there either.