isReachable() returns true even when I disconnect my computer
Hi,
I have problems with isReachable(). It returns true even though I think it should return false. I have a loop that calls isReachable() for some hosts with 5 seconds delay and 2 seconds timeout to isReachable().
I have tested both with one host and with more than one host.
Please see my scenarios below:
Case 1:
First I have the firewall to allow traffic and isReachable() returns true for the hosts, and ping (run from DOS window) finds the hosts. Everything is fine.
Then I set my firewall to blocks all traffic.
isReachable still returns true. Ping (run from a DOS window) cannot find the hosts. If I switch off the ADSL-modem, isReachable() still returns true for the hosts (however Windows notifies that the cable is unplugged). However I think one call to isReachable takes longer time. Then I unplug the cable from the modem. No difference, isReachable() returns true.
Case 2:
First I have the firewall to allow traffic and isReachable() returns true for the hosts, and ping (run from DOS window) finds the hosts.
Then I set my firewall to blocks all traffic.
isReachable() still returns true. Then I unplug the cable from the modem. isReachable() still returns true. Ping does not (of course).
Case 3:
First I have the firewall to allow traffic and isReachable() returns true for the hosts, and ping (run from DOS window) finds the hosts.
Then I switch off the ADSL modem. isReachable() still returns true. Ping does not (of course). Unplugging the cable from the modem does not do any difference. isReachable() returns true. Ping does not of course.
Case 4:
First I have the firewall to allow traffic and isReachable() returns true for the hosts, and ping (from DOS window) finds the hosts.
Then I unplug the cable from the modem (without first setting the firewall to block traffic or switching off the modem.). isReachable() now finaly returns false.
To sumarize:
I have to unplug the cable from my ADSL modem to get isReachable() to return false. If I either set the firewall to block traffic or switch off the modem first, not even unplugging the cable will get isReachable() to return false.
I have tested this alot, and the outcome is always the same.
During some test of the different scenarios 1, 2 and 3, I could see that isReachable() returned false in one call, but the next returned true. So some times it detected a change in reachability, but still returned true the next call.
Anybody having any idea why this is so?
Has it to do with caching of information or what could case it?
I would really appreciate help. I have read about other peoples problems with isReachable(), but none of the problems I have read about has to do with blocking the traffic or turning off the modem or unplugging the cable.
Regards
Michael

