Class WebSocketDocs.StreamingListenerEndpoint
- All Implemented Interfaces:
Session.Listener
- Enclosing class:
WebSocketDocs
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.websocket.api.Session.Listener
Session.Listener.Abstract, Session.Listener.AbstractAutoDemanding, Session.Listener.AutoDemanding
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
onWebSocketOpen
(Session session) A WebSocketSession
has opened successfully and is ready to be used.void
onWebSocketPartialBinary
(ByteBuffer payload, boolean fin, Callback callback) A WebSocket BINARY (or associated CONTINUATION) frame has been received.void
onWebSocketPartialText
(String payload, boolean fin) A WebSocket TEXT (or associated CONTINUATION) frame has been received.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.websocket.api.Session.Listener
onWebSocketBinary, onWebSocketClose, onWebSocketError, onWebSocketFrame, onWebSocketPing, onWebSocketPong, onWebSocketText
-
Constructor Details
-
StreamingListenerEndpoint
public StreamingListenerEndpoint()
-
-
Method Details
-
onWebSocketOpen
Description copied from interface:Session.Listener
A WebSocket
Session
has opened successfully and is ready to be used.Applications can store the given
Session
as a field so it can be used to send messages back to the other peer.- Specified by:
onWebSocketOpen
in interfaceSession.Listener
- Parameters:
session
- the WebSocket session
-
onWebSocketPartialText
Description copied from interface:Session.Listener
A WebSocket TEXT (or associated CONTINUATION) frame has been received.
- Specified by:
onWebSocketPartialText
in interfaceSession.Listener
- 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
- whether this is the last frame
-
onWebSocketPartialBinary
Description copied from interface:Session.Listener
A WebSocket BINARY (or associated CONTINUATION) frame has been received.
The
ByteBuffer
is read-only, and will be recycled when thecallback
is completed.- Specified by:
onWebSocketPartialBinary
in interfaceSession.Listener
- Parameters:
payload
- the BINARY frame payloadfin
- whether this is the last framecallback
- the callback to complete when the payload has been processed
-