public interface WebSocketListener
限定符和类型 | 方法和说明 |
---|---|
void |
onClose(WebSocket socket)
连接关闭时
|
void |
onError(WebSocket socket,
java.lang.Throwable error)
出错时
|
void |
onMessage(WebSocket socket,
java.nio.ByteBuffer binary)
收到消息时
|
void |
onMessage(WebSocket socket,
java.lang.String text)
收到消息时
|
void |
onOpen(WebSocket socket)
连接打开时(可以做个签权)
|
default void |
onPing(WebSocket socket)
Ping 时
|
default void |
onPong(WebSocket socket)
Pong 时
|
void onOpen(WebSocket socket)
void onMessage(WebSocket socket, java.lang.String text) throws java.io.IOException
java.io.IOException
void onMessage(WebSocket socket, java.nio.ByteBuffer binary) throws java.io.IOException
java.io.IOException
void onClose(WebSocket socket)
void onError(WebSocket socket, java.lang.Throwable error)
default void onPing(WebSocket socket)
default void onPong(WebSocket socket)