Skip to content

wanghe826/PingTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

PingTool

使用方法:

  1. 将pingTool拷入到xcode工程
  2. 引入头文件
#import "WHPingTester.h"
  1. 设置属性变量,并在controller 上面实现代理。
  @property(nonatomic, strong) WHPingTester* pingTester;
  //ping
  self.pingTester = [[WHPingTester alloc] initWithHostName:@"www.baidu.com"];
  self.pingTester.delegate = self;
  [self.pingTester startPing];
  1. 实现委托.
- (void) didPingSucccessWithTime:(float)time withError:(NSError *)error
{
    if(!error)
    {
        NSLog(@"ping的延迟是--->%f", time);
    }else{
        NSLog(@"网络不通");
     }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published