This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "ICMP Echo/Ping request" Watch "ICMP Echo/Ping request" New topic

ICMP Echo/Ping request

Bernd Stransky
Ranch Hand

Joined: Nov 20, 2001
Posts: 47
is there any way to implement a ICMP Echo/PING request based on Java?
or is that only possible with some platform specific code?
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 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
I agree. Here's the link:
subject: ICMP Echo/Ping request
It's not a secret anymore!