This seems like it should be a simple solution to find, but I'm not having any luck. I want to write a simple ping/traceroute/dns troubleshooting app, but am simply not finding any documentation or examples on sending ICMP ECHO packets with set TTLs and interpreting their responses. I realize that Java likes to keep you away from "low-level" networking, but ICMP is a basic, major part of networking. Frankly, I'm shocked at the apparent difficulty. Am I making this more complicated than need be, or is there literally no good way to go about this? If the latter, in what "bad" way do you most often work around this shortcoming?
views:
43answers:
1
A:
Am I making this more complicated than need be, or is there literally no good way to go about this?
There is no pure-Java way to go about this. Java has never supported ICMP beyond its limited use in isReachable()
, and I cannot even confirm that this use of ICMP exists in Android.
However, you could try to use the NDK to link in a C library that implements ICMP.
CommonsWare
2010-09-26 23:37:07