Latest 0.1.2
Homepage https://github.com/jackymelb/fpingx
License BSD
Platforms ios 8.0, osx 10.10
Frameworks Foundation
Authors

Language
[CocoaPods]()
Carthage Compatible
[CocoaPods]()

A wrapper of fping which is a high performance ping tool. More information about fping is available here.

Installation

CocoaPods

add the following line to your Podfile:

pod "fpingx"

Carthage

github "jackymelb/fpingx"

Usage

import fpingx

fpingx.ping(hosts: ["google.com", "baidu.com", "apple.com", "abc.c"], progress: { (progress) in
    print(progress)
}) { (result) in
    print(result)
}

The progress is a float number between 0-1.

The result is a dictionary which key is host string, value is FpingxResult.

Notice that FpingxResult is a struct defined as:

public struct FpingxResult {

    public let host: String

    /// number of sent
    public let xmt: Int

    /// number of received
    public let rcv: Int

    /// loss percentage (value from 0-100)
    public var loss: Int {
        return xmt > 0 ? (xmt - rcv) * 100 / xmt : 0
    }

    /// nil if rcv is 0
    public let avg: Int?

    /// nil if rcv is 0
    public let min: Int?

    /// nil if rcv is 0
    public let max: Int?

}

Author

jzau (Twitter: @Jie)

Credits of fping

Current maintainer: David Schweikert Latest podspec

{
    "name": "fpingx",
    "version": "0.1.2",
    "summary": "A swift wrapper of fping which is a high performance ping tool",
    "description": "A swift wrapper of fping which is a high performance ping tool",
    "homepage": "https://github.com/jackymelb/fpingx",
    "license": {
        "type": "BSD",
        "file": "LICENSE"
    },
    "authors": {
        "jackymelb": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jackymelb/fpingx.git",
        "tag": "0.1.2"
    },
    "social_media_url": "https://twitter.com/jackymelb",
    "platforms": {
        "ios": "8.0",
        "osx": "10.10"
    },
    "source_files": [
        "fpingx/fpingx.swift",
        "fpingx/fpingx.h",
        "fping/*"
    ],
    "public_header_files": [
        "fpingx/fpingx.h",
        "fping/*.h"
    ],
    "frameworks": "Foundation"
}

Pin It on Pinterest

Share This