TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Aug 2017 |
SwiftSwift Version | 3.0 |
Maintained by Maros Betko--description=myMac.
Simple pod, that allows you to ping multiple addresses at the same time.
To start pinging call Ping.start(address:timeout:retries:completion)
on a Ping.shared
instance, or create your own instance of Ping class. All arguments except address are optional and can be left out.
Ping.shared.start("[address]", timeout: 5, retires: 3) { response in
switch response {
case .notSent(let error):
/* ... */
case .timedOut:
/* ... */
case .succeeded(let latency);
/* ... */
}
}
To stop ping request in progress call Ping.stop(address)
on instance you started the ping on. This will stop any possible retries and safely discard all responses from given address.
Ping.shared.stop("[address]")
To stop all ping requests at once use Ping.stopAll()
. This will stop all pings that are handled by the instance of Ping class you call it on.
Ping.shared.stopAll()
Into your Podfile add:
pod 'MultiPing'
shared
instance or create a new instance of Ping class with it’s default constructorPing.removeAll()
that removes all pings in progress from given instance of Ping class