public class ModernPing extends ATCPPing
MCPingResponseATCPPing.PacketReader, ATCPPing.PacketWriterconnectTimeout, protocolVersion, readTimeout, socketFactory| Constructor and Description |
|---|
ModernPing(ITCPSocketFactory socketFactory,
int connectTimeout,
int readTimeout,
int protocolVersion) |
| Modifier and Type | Method and Description |
|---|---|
int |
getDefaultPort() |
void |
ping(ServerAddress serverAddress,
IStatusListener statusListener)
Ping the server and call the status listener.
|
protected void |
readPacket(MCInputStream is,
int packetId,
ATCPPing.PacketReader packetReader)
Read a packet from the input stream.
|
protected void |
writePacket(MCOutputStream os,
int packetId,
ATCPPing.PacketWriter packetWriter)
Write a packet to the output stream.
|
connect, prepareResponseprepareResponsepublic ModernPing(ITCPSocketFactory socketFactory, int connectTimeout, int readTimeout, int protocolVersion)
public int getDefaultPort()
getDefaultPort in class APingpublic void ping(ServerAddress serverAddress, IStatusListener statusListener)
APingprotected void writePacket(MCOutputStream os, int packetId, ATCPPing.PacketWriter packetWriter) throws java.io.IOException
ATCPPingwritePacket in class ATCPPingos - The output streampacketId - The packet idpacketWriter - The packet writerjava.io.IOException - If an I/O error occursprotected void readPacket(MCInputStream is, int packetId, ATCPPing.PacketReader packetReader) throws java.io.IOException
ATCPPingreadPacket in class ATCPPingis - The input streampacketId - The packet idpacketReader - The packet readerjava.io.IOException - If an I/O error occurs