- All Known Implementing Classes:
RealWebSocket
- Enclosing class:
WebSocketReader
public static interface WebSocketReader.FrameCallback
A callback interface for WebSocket frame events.
-
Method Summary
Modifier and TypeMethodDescriptionvoidonReadClose(int code, String reason) Invoked when a close frame is received.voidonReadMessage(String text) Invoked when a text message is received.voidonReadMessage(org.miaixz.bus.core.io.ByteString bytes) Invoked when a binary message is received.voidonReadPing(org.miaixz.bus.core.io.ByteString buffer) Invoked when a ping frame is received.voidonReadPong(org.miaixz.bus.core.io.ByteString buffer) Invoked when a pong frame is received.
-
Method Details
-
onReadMessage
Invoked when a text message is received.- Parameters:
text- The text content.- Throws:
IOException- if an error occurs during processing.
-
onReadMessage
Invoked when a binary message is received.- Parameters:
bytes- The binary content.- Throws:
IOException- if an error occurs during processing.
-
onReadPing
void onReadPing(org.miaixz.bus.core.io.ByteString buffer) Invoked when a ping frame is received.- Parameters:
buffer- The ping payload.
-
onReadPong
void onReadPong(org.miaixz.bus.core.io.ByteString buffer) Invoked when a pong frame is received.- Parameters:
buffer- The pong payload.
-
onReadClose
Invoked when a close frame is received.- Parameters:
code- The close code.reason- The close reason.
-