Server Ping with iPhone

2020-03-24 06:39发布

I'm writing an app that needs to know which of two servers responds fastest. One server is in my time zone, the other is far away.

How do I get the round trip time from a server ping on the iPhone?
I looked at Reachability, and I don't think it does what I need in this case. Alternate solutions are welcome as well. Thanks!

1条回答
▲ chillily
2楼-- · 2020-03-24 07:22

You could use this implementation of ping - source

Or, Apple has an example App you can look at - SimplePing

Another option is to use an existing lib: http://www.kernelthread.com/projects/hanoi/html/icmp.html

查看更多
登录 后发表回答