• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

testing Reachability of a server machine.

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic