Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how i do this?

 
Mandar Khire
Ranch Hand
Posts: 567
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use windows XP.Every time i start my computer, i run 1 command that is:-
ping xxx.xxx.xxx.xxx -t
so i check network connectivity between my computer to default Gateway.
I want to create java program which i run & check same connectivity.
Can i do this?Is it possible? Any hint, so link so i read related topic & try to do this.
I try to search but i didn't get.
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're in luck - support for this has been added in Java 5.0

Check out java.net.InetAddress, it has a method called "isReachable" which takes a timeout; there is also an overloaded version that takes a NetworkInterface and ttl value as well.
 
Campbell Ritchie
Sheriff
Posts: 48453
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't use thread titles like "how I do this?" Please use a title which tells people what the thread is about.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic