how can I determine a host, let's say http://myhost:8080/ is reachable or not.
Asked
Active
Viewed 275 times
0
-
possible duplicate of [How to find server is reachable with Reachability code in iPhone?](http://stackoverflow.com/questions/5819088/how-to-find-server-is-reachable-with-reachability-code-in-iphone) – Abizern Jun 20 '11 at 13:16
2 Answers
3
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

Wolfgang Schreurs
- 11,779
- 7
- 51
- 92
-
thanks a lot. But it does work for "myhost" but it fails when port number is added. @Wolfgang Schreurs – FsoulForever Jun 20 '11 at 14:08
0
Use the reachability class of apple. reachability This might help you:)

DivineDesert
- 6,924
- 1
- 29
- 61