public interface WebSocketListener
WebSocketListener for WebSocket events. Use the appropriate listener for receiving message bytes.| Modifier and Type | Method and Description |
|---|---|
default void |
onBinaryFrame(byte[] payload,
boolean finalFragment,
int rsv)
Invoked when a binary frame is received.
|
void |
onClose(WebSocket websocket,
int code,
String reason)
Invoked when the
WebSocket is closed. |
void |
onError(Throwable t)
Invoked when the
WebSocket crashes. |
void |
onOpen(WebSocket websocket)
Invoked when the
WebSocket is open. |
default void |
onPingFrame(byte[] payload)
Invoked when a ping frame is received
|
default void |
onPongFrame(byte[] payload)
Invoked when a pong frame is received
|
default void |
onTextFrame(String payload,
boolean finalFragment,
int rsv)
Invoked when a text frame is received.
|
void onOpen(WebSocket websocket)
WebSocket is open.websocket - the WebSocketvoid onClose(WebSocket websocket, int code, String reason)
WebSocket is closed.websocket - the WebSocketcode - the status codereason - the reason messagedefault void onBinaryFrame(byte[] payload,
boolean finalFragment,
int rsv)
payload - a byte arrayfinalFragment - true if this frame is the final fragmentrsv - extension bitsdefault void onTextFrame(String payload, boolean finalFragment, int rsv)
payload - a UTF-8 String messagefinalFragment - true if this frame is the final fragmentrsv - extension bitsdefault void onPingFrame(byte[] payload)
payload - a byte arraydefault void onPongFrame(byte[] payload)
payload - a byte arrayCopyright © 2020. All rights reserved.