Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how i do this?

 
Mandar Khire
Ranch Hand
Posts: 569
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: 20606
60
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
Pie
Posts: 49770
69
  • 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