Is it wise to use Reachability to check for a remote host's availability?

前端 未结 6 1014
不知归路
不知归路 2021-01-01 05:59

Is it wise to use Reachability Class(from Apple) to check for a remote host\'s availability ? say for example, www.google.com

or should I use

NSStri         


        
6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-01 06:48

    Reachability will not tell you if a remote host is contactable. It only tests the first hop i.e. can you send a packet to your router. If the router cannot reach the wider internet, reachability will still tell you that you have a wifi connection. You have to implement one of the other suggested solutions to test "true" reachability.

提交回复
热议问题