// The Pinger object measures network latency by sending a packet
// to the UDP Echo Port (Port 7) and timing how long it takes.
// We use this port instead of ICMP because I would have to
// use native methods in order to produce ICMP packets.
调试欢乐多
Some possible BSD options that are not supported in java:
RAW/ICMP SOCKETS:
The main argument in favor of this one seemed to be so people could write "ping" in java. Security nightmare. Must be root on UNIX machines.
...(http://java.sun.com/j2se/1.3/docs/guide/net/socketOpt.html)
--------------------------------------------------------------------------------
Q10.21
Will raw sockets ever be introduced -- and if not, how can I create ICMP messages so that I can do operations like `ping'? (this is the only one which has no answer in FAQ)(http://java.sun.com/docs/books/faq/faqionet.html#s10.4)This is words from java.sun.comSo, I think maybe u can't write 'ping' in Java.
全体参与者:多谢您们的参与,请继续提供帮助!
or email to me?
[email protected]
I will really appreciate it.