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(IUDPSocketFactory socketFactory,
int readTimeout) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected IUDPSocket |
connect(ServerAddress serverAddress)
Create a new datagram socket.
|
protected void |
readPacket(IUDPSocket s,
int bufferSize,
AUDPPing.PacketReader packetReader)
Read a packet from the given socket.
|
protected void |
writePacket(IUDPSocket s,
AUDPPing.PacketWriter packetWriter)
Write a packet and send it to the given server address.
|
getDefaultPort, ping, prepareResponsepublic AUDPPing(IUDPSocketFactory socketFactory, int readTimeout)
protected final IUDPSocket connect(ServerAddress serverAddress) throws java.io.IOException
serverAddress - The server addressjava.io.IOException - If an I/O error occurspublic void close()
throws java.lang.Exception
java.lang.Exceptionprotected void writePacket(IUDPSocket s, AUDPPing.PacketWriter packetWriter) throws java.io.IOException
s - The UDP socketpacketWriter - The packet writerjava.io.IOException - If an I/O error occursprotected void readPacket(IUDPSocket 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