Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ICMP Echo/Ping request

 
Bernd Stransky
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this the Sockets forum.
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic