测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | MIT |
发布最后发布 | 2017年8月 |
SwiftSwift 版本 | 3.0 |
维护者 Maros Betko--description=myMac.
简单的 pod,允许您同时ping多个地址。
要开始ping,请在一个 Ping.shared
实例上调用 Ping.start(address:timeout:retries:completion)
,或创建 Ping 类的自己的实例。除地址以外的所有参数都是可选的,可以省略。
Ping.shared.start("[address]", timeout: 5, retires: 3) { response in
switch response {
case .notSent(let error):
/* ... */
case .timedOut:
/* ... */
case .succeeded(let latency);
/* ... */
}
}
要停止正在进行的ping请求,请在一个你开始ping的实例上调用 Ping.stop(address)
。这将停止所有可能的重试,并安全丢弃给定地址的所有响应。
Ping.shared.stop("[address]")
要一次性停止所有ping请求,请使用 Ping.stopAll()
。这将停止你调用的Ping类实例处理的全部ping。
Ping.shared.stopAll()
在 Podfile 中添加
pod 'MultiPing'
shared
实例或使用默认构造函数创建 Ping 类的新实例来开始ping。Ping.removeAll()
,可以删除给定 Ping 类实例正在进行的所有ping。