public abstract class AUDPPing extends APing
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
AUDPPing.PacketReader |
protected static interface |
AUDPPing.PacketWriter |
| Constructor and Description |
|---|
AUDPPing(int readTimeout) |
| Modifier and Type | Method and Description |
|---|---|
protected java.net.DatagramSocket |
connect()
Create a new datagram socket.
|
protected void |
readPacket(java.net.DatagramSocket s,
int bufferSize,
AUDPPing.PacketReader packetReader)
Read a packet from the given socket.
|
protected void |
writePacket(java.net.DatagramSocket s,
ServerAddress serverAddress,
AUDPPing.PacketWriter packetWriter)
Write a packet and send it to the given server address.
|
getDefaultPort, ping, prepareResponseprotected final java.net.DatagramSocket connect()
throws java.io.IOException
java.io.IOException - If an I/O error occursprotected void writePacket(java.net.DatagramSocket s,
ServerAddress serverAddress,
AUDPPing.PacketWriter packetWriter)
throws java.io.IOException
s - The UDP socketserverAddress - The server addresspacketWriter - The packet writerjava.io.IOException - If an I/O error occursprotected void readPacket(java.net.DatagramSocket s,
int bufferSize,
AUDPPing.PacketReader packetReader)
throws java.io.IOException
s - The UDP socketbufferSize - The buffer sizepacketReader - The packet readerjava.io.IOException - If an I/O error occurs