简体   繁体   中英

iPhone: How can I determine a host is reachable or not?

我如何确定主机,比方说http:// myhost:8080 /是否可以访问。

You could use the Reachability class from Apple, it has a method called -reachabilityWithHostName: , which will inform you if a host is reachable and which connection(s) are available (WiFi, GSM).

Check the code: http://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html

Use the reachability class of apple. reachability This might help you:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM