Package org.eclipse.jetty.websocket.api
Interface WebSocketPartialListener
- All Superinterfaces:
WebSocketConnectionListener
WebSocket Partial Message Listener interface for incoming WebSocket TEXT/BINARY/CONTINUATION frames.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
onWebSocketPartialBinary
(ByteBuffer payload, boolean fin) A WebSocket BINARY (or associated CONTINUATION) frame has been received.default void
onWebSocketPartialText
(String payload, boolean fin) A WebSocket TEXT (or associated CONTINUATION) frame has been received.Methods inherited from interface org.eclipse.jetty.websocket.api.WebSocketConnectionListener
onWebSocketClose, onWebSocketConnect, onWebSocketError
-
Method Details
-
onWebSocketPartialBinary
A WebSocket BINARY (or associated CONTINUATION) frame has been received.Important Note: The payload
ByteBuffer
cannot be modified, and the ByteBuffer object itself will be recycled on completion of this method call, make a copy of the data contained within if you want to retain it between calls.- Parameters:
payload
- the binary message frame payloadfin
- true if this is the final frame, false otherwise
-
onWebSocketPartialText
A WebSocket TEXT (or associated CONTINUATION) frame has been received.- Parameters:
payload
- the text message payloadNote that due to framing, there is a above average chance of any UTF8 sequences being split on the border between two frames will result in either the previous frame, or the next frame having an invalid UTF8 sequence, but the combined frames having a valid UTF8 sequence.
The String being provided here will not end in a split UTF8 sequence. Instead this partial sequence will be held over until the next frame is received.
fin
- true if this is the final frame, false otherwise
-