|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.act365.net.ping.Ping
Implements the well-known ping network utility.
Constructor Summary | |
Ping(java.net.DatagramSocket socket,
int transmitted)
Creates a Ping object to listen for ICMP messages. |
Method Summary | |
void |
interrupt()
Interrupts the receive cycle. |
static void |
main(java.lang.String[] args)
Executes the Ping service. |
void |
receive()
Listens for ICMP packets. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Ping(java.net.DatagramSocket socket, int transmitted)
Method Detail |
public void interrupt()
public void receive()
public static void main(java.lang.String[] args)
Ping -c count -s nbytes -p protocol -l localhost -t ttl hostname
.
-c count
(optional) defines the number of packets to be broadcast.
By default, the broadcast will continue endlessly.
-s nbytes
(optional) defines the number of bytes to appear
in each packet. The default is 56.
-p protocol
(optional) defines the socket protocol to be used.
By default, ICMP will be used - the alternative is RawICMP.
-l localhost
(optional) should be specified if the protocol
has been set to RawICMP. The information will be used to construct the IP header.
-t ttl
(optional) is the time-to-live to be used if the RawICMP
protocol has been selected. The default is 64.
hostname
define the remote host.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |