public abstract class ATCPPing extends APing
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
ATCPPing.PacketReader |
protected static interface |
ATCPPing.PacketWriter |
| Modifier and Type | Field and Description |
|---|---|
protected int |
connectTimeout |
protected int |
protocolVersion |
protected int |
readTimeout |
| Constructor and Description |
|---|
ATCPPing(int connectTimeout,
int readTimeout,
int protocolVersion) |
| Modifier and Type | Method and Description |
|---|---|
protected java.net.Socket |
connect(ServerAddress serverAddress)
Connect a socket to the given server address.
|
protected void |
prepareResponse(ServerAddress serverAddress,
com.google.gson.JsonObject response)
Prepare the response by adding default server information.
|
protected abstract void |
readPacket(MCInputStream is,
int packetId,
ATCPPing.PacketReader packetReader)
Read a packet from the input stream.
|
protected abstract void |
writePacket(MCOutputStream os,
int packetId,
ATCPPing.PacketWriter packetWriter)
Write a packet to the output stream.
|
getDefaultPort, ping, prepareResponseprotected final int connectTimeout
protected final int readTimeout
protected final int protocolVersion
public ATCPPing(int connectTimeout,
int readTimeout,
int protocolVersion)
protected abstract void writePacket(MCOutputStream os, int packetId, ATCPPing.PacketWriter packetWriter) throws java.io.IOException
os - The output streampacketId - The packet idpacketWriter - The packet writerjava.io.IOException - If an I/O error occursprotected abstract void readPacket(MCInputStream is, int packetId, ATCPPing.PacketReader packetReader) throws java.io.IOException
is - The input streampacketId - The packet idpacketReader - The packet readerjava.io.IOException - If an I/O error occursprotected final java.net.Socket connect(ServerAddress serverAddress) throws java.io.IOException
serverAddress - The server addressjava.io.IOException - If an I/O error occursprotected final void prepareResponse(ServerAddress serverAddress, com.google.gson.JsonObject response)
APing.prepareResponse(ServerAddress, JsonObject, int) for more information.serverAddress - The server addressresponse - The response