• Post Reply Bookmark Topic Watch Topic
  • New Topic

testing Reachability of a server machine.

 
Jigs Mehta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The problem here is that if I disconnect the network cable for "mymachine" the add.isReachable(3000) retuns true.
I disconnect or unplug the network cord at runtime as I have placed the code inside a while(true) loop.

Can anybody expalin me why the method is returning true and not false.

Also if there are other ways to achieve this then let me know.

Thanks in advance for help!!
 
Rusty Shackleford
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe it first checks the local DNS cache.

A more reliable way would be to ping or traceroute(if a firewall doesn't drop it) or try to connect. Other than that you will need raw packets, or use another program such as nmap or hping2.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!