wood burning stoves 2.0*
The moose likes Sockets and Internet Protocols and the fly likes ICMP Echo/Ping request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "ICMP Echo/Ping request" Watch "ICMP Echo/Ping request" New topic
Author

ICMP Echo/Ping request

Bernd Stransky
Ranch Hand

Joined: Nov 20, 2001
Posts: 47
Hello,
is there any way to implement a ICMP Echo/PING request based on Java?
or is that only possible with some platform specific code?
Thanks,
Bernd
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Moving this the Sockets forum.


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Nope. ICMP packets require a raw socket and there is no raw socket implementation in the java.net package. There is a java library that you can use to send and receive ICMP packets. You can find that library here: Jpcap. The documetation is shoddy, but luckily there are only a few classes and if you have a working knowledge of network protocols you should be able to muddle thru. If you are using a Windows machine, you will need the WinPcap (dll) library. You can find that here WinPcap.
Michael Morris
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ICMP Echo/Ping request
 
Similar Threads
Using ip address in place of localhost
status of internet connection
How to tell whether a computer is on&running?
PING program
Pinging In Java