swi

SwiftPing

ICMP Ping in swift

Showing:

Popularity

Downloads/wk

0

GitHub Stars

82

Maintenance

Last Commit

3yrs ago

Contributors

2

Package

Dependencies

0

License

MIT

Categories

Readme

SwiftPing

CI Status Version Carthage Compatible License Platform Coverage Status

Description

SwiftPing ICMP Pinging in swift..

Usage

let pingInterval:TimeInterval = 3
let timeoutInterval:TimeInterval = 4
let configuration = PingConfiguration(pInterval:pingInterval, withTimeout:  timeoutInterval)

print(configuration)

SwiftPing.ping(host: "google.com", configuration: configuration, queue: DispatchQueue.main) { (ping, error) in
  print("\(ping)")
  print("\(error)")
}

SwiftPing.pingOnce(host: "google.com", configuration: configuration, queue: DispatchQueue.global()) { (response: PingResponse) in
    print("\(response.duration)")
    print("\(response.ipAddress)")
    print("\(response.error)")
}

class PingResponse : NSObject {

    public var identifier: UInt32

    public var ipAddress: String?

    public var sequenceNumber: Int64

    public var duration: TimeInterval

    public var error: NSError?
}

Installation

ICMP Pinging in swift.

*Thanks to https://github.com/OliverLetterer/SPLPing. Migrated it to Swift 3 and added 1 enhancement.

Enhancement: Now pinging is supportable in any of the GCD Queue, where user wants.

SwiftPing is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SwiftPing'

SwiftPing is also available through Carthage. To install just write into your Cartfile:

github "ankitthakur/SwiftPing"

Todo

Test cases needs to be added

Author

Ankit Thakur, ankitthakur85@icloud.com

Contributing

We would love you to contribute to SwiftPing and request you follow these guidelines.

Raising issues

Please raise any bug reports on the issue tracker. Be sure to search the list to see if your issue has already been raised.

A good bug report is one that make it easy for us to understand what you were trying to do and what went wrong. Provide as much context as possible so we can try to recreate the issue.

If you find a bug, please submit a pull request with a failing test case displaying the bug or create an issue. Please add tests alongside your pull requests.

Coding standards

Please ensure you follow the coding standards used throughout the existing code base. Some basic rules include:

  • all PRs must have passing builds for all operating systems.

License

SwiftPing is available under the MIT license. See the LICENSE file for more info.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100