Skip to content

Works fine with Wifi but not 4G #38

@houmie

Description

@houmie

Hello,

The following code works fine on Wifi but throws PingError.hostNotFound exception on 4G.
That makes no sense though, because the same host IP works on Wifi, but not on 4G.

do {
    let ping = try SwiftyPing(host: serverIP, configuration: PingConfiguration(interval: 0.5, with: 1), queue: DispatchQueue.global())
    ping.finished = { (result) in
        completed(true, result.roundtrip?.average ?? 0.0)
    }
    ping.targetCount = count
    try ping.startPinging()
} catch let error {
    print("Error: \(error.localizedDescription)")
    completed(false, 0.0)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions