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