-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pings to same servers are much higher on Mac than iOS #34
Comments
If you ping the same host on your Mac with the command line utility As for getting the average, there's a let ping = try! SwiftyPing(host: "google.com", configuration: PingConfiguration(interval: 1.0, with: 1), queue: DispatchQueue.global())
// this is called after every ping
ping.observer = { (response) in
print("\(response.duration * 1000) ms"
}
// this is called after five pings
ping.finished = { (result) in
print("avg roundtrip: \(result.roundtrip!.average * 1000) ms")
}
ping.targetCount = 5
try! ping.startPinging() |
Sorry @samiyr for the late response. I have applied your suggestion. Unfortunately the issue remains. I live in London and the server ping to a server in London should be very low. On Mac if my SwiftyPing on iOS with I think this is a very useful project. It would be great to make it more consistent across the platforms though. I'm not sure why this is happening.
Many Thanks. |
Had the same problem, and finally figured it out on Mac! You have to enable both capabilities "Incoming Connections (Server)" and "Outcoming Connections (Client)" in App Sandbox, then it works! Now latency is exactly the same like on iOS and Terminal. |
A very strange behaviour. I get 60ms ping on iOS and same server on Mac shows 230ms.
Is there a good way to do 5 pings and get the average of it?
The text was updated successfully, but these errors were encountered: