public interface ClientSocketListener
extends java.util.EventListener
ClientSocket
related events.Modifier and Type | Method and Description |
---|---|
void |
connected()
Called after a connection to a Crossfire server has been established.
|
void |
connecting()
Called when connecting to a Crossfire server.
|
void |
disconnected(java.lang.String reason)
Called after the connection has been closed.
|
void |
disconnecting(java.lang.String reason,
boolean isError)
Called when the connection is being teared down.
|
void |
packetReceived(java.nio.ByteBuffer packet)
Called whenever a packet is received from the Crossfire server.
|
void |
packetSent(byte[] buf,
int len)
Called whenever a packet has been sent to the Crossfire server.
|
void connected()
void connecting()
void disconnected(@NotNull java.lang.String reason)
reason
- the disconnect reasonvoid disconnecting(@NotNull java.lang.String reason, boolean isError)
reason
- the disconnect reasonisError
- whether the disconnect is unexpectedvoid packetReceived(@NotNull java.nio.ByteBuffer packet) throws UnknownCommandException
packet
- the packet contentsUnknownCommandException
- if the packet cannot be processedvoid packetSent(@NotNull byte[] buf, int len)
buf
- the packet contents; must not be modified by client codelen
- the length of the packet