aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Pinging In Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Pinging In Java" Watch "Pinging In Java" New topic
Author

Pinging In Java

Murat Balkan
Ranch Hand

Joined: Sep 10, 2002
Posts: 127
Hi ,
Is there a way to ping in java.?
I need to have echo response times of some addresses but I could not find a spesific class that does ping.
Thanks
Murat
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Ping is implemented using a low-level protocol named ICMP, and Java doesn't support it directly. You have three choices:
  • Use the UDP 'echo' protocol or something similar instead of real 'ping', like this applet;
  • Execute an external 'ping' program using Runtime.exec(); or
  • Use JNI to interface to native code that implements ICMP ping.


  • [Jess in Action][AskingGoodQuestions]
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Pinging In Java