tonymillion / Reachability

ARC and GCD Compatible Reachability Class for iOS and MacOS. Drop in replacement for Apple Reachability

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check connection with a specific host with only one Reachability instance.

lixiaonin opened this issue · comments

I recently start to use your Reachability, and thx, it's been convenience.

I'm just asking is there a way to get the accurate status of my server's connection at any moment, with only one instance of Reachability in appDelegate.

I'm kinda confused because, I tried to create an instance by using "reachabilityWithHostName" with my server's base url, checked the connection with the instance method -(BOOL)isReachable; and it seemed it didn't give me the correct answer,(and it didn't ping my server at all, from what I observed on server side.).

(for example:
1, I turned off my server (gunicorn off, but nginx/apache on)
2, in my appDelegate, i used [Reachability reachabilityWithHostName:BASE_URL]; and check immediately the connection, it's says it's connected.)
3, i totally turned down my server (nginx/apache off), and do step 2 again, it still says it's connected.

Maybe i'm using it in a wrong way. I'm just a little confused how it should work in the case that I need to check the availability of a specific remote server. (or do u recommend I send explicit requests to check that in API way if this tool is not meant to be for that purpose)

Thx