example
Class Ping.Pinger
java.lang.Object
example.Ping.Pinger
- Direct Known Subclasses:
- Ping.PingerIPv6
- Enclosing class:
- Ping
public static class Ping.Pinger
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
socket
protected RawSocket socket
sendPacket
protected org.savarese.vserv.tcpip.ICMPEchoPacket sendPacket
recvPacket
protected org.savarese.vserv.tcpip.ICMPEchoPacket recvPacket
offset
protected int offset
length
protected int length
dataOffset
protected int dataOffset
requestType
protected int requestType
replyType
protected int replyType
sendData
protected byte[] sendData
recvData
protected byte[] recvData
srcAddress
protected byte[] srcAddress
sequence
protected int sequence
identifier
protected int identifier
listener
protected Ping.EchoReplyListener listener
Ping.Pinger
protected Ping.Pinger(int id,
int protocolFamily,
int protocol)
throws java.io.IOException
- Throws:
java.io.IOException
Ping.Pinger
public Ping.Pinger(int id)
throws java.io.IOException
- Throws:
java.io.IOException
computeSendChecksum
protected void computeSendChecksum(java.net.InetAddress host)
throws java.io.IOException
- Throws:
java.io.IOException
setEchoReplyListener
public void setEchoReplyListener(Ping.EchoReplyListener l)
close
public void close()
throws java.io.IOException
- Closes the raw socket opened by the constructor. After calling
this method, the object cannot be used.
- Throws:
java.io.IOException
sendEchoRequest
public void sendEchoRequest(java.net.InetAddress host)
throws java.io.IOException
- Throws:
java.io.IOException
receive
public void receive()
throws java.io.IOException
- Throws:
java.io.IOException
receiveEchoReply
public void receiveEchoReply()
throws java.io.IOException
- Throws:
java.io.IOException
ping
public long ping(java.net.InetAddress host)
throws java.io.IOException
- Issues a synchronous ping.
- Parameters:
host
- The host to ping.
- Returns:
- The round trip time in nanoseconds.
- Throws:
java.io.IOException
getRequestDataLength
public int getRequestDataLength()
- Returns:
- The number of bytes in the data portion of the ICMP ping request
packet.
getRequestPacketLength
public int getRequestPacketLength()
- Returns:
- The number of bytes in the entire IP ping request packet.
Copyright © 2004-2007 Daniel F. Savarese. All Rights Reserved.