Class WebSocketDocs.StreamingListenerEndpoint

java.lang.Object
org.eclipse.jetty.docs.programming.WebSocketDocs.StreamingListenerEndpoint
All Implemented Interfaces:
Session.Listener
Enclosing class:
WebSocketDocs

public class WebSocketDocs.StreamingListenerEndpoint extends Object implements Session.Listener
  • Constructor Details

    • StreamingListenerEndpoint

      public StreamingListenerEndpoint()
  • Method Details

    • onWebSocketOpen

      public void onWebSocketOpen(Session session)
      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 interface Session.Listener
      Parameters:
      session - the WebSocket session
    • onWebSocketPartialText

      public void onWebSocketPartialText(String payload, boolean fin)
      Description copied from interface: Session.Listener

      A WebSocket TEXT (or associated CONTINUATION) frame has been received.

      Specified by:
      onWebSocketPartialText in interface Session.Listener
      Parameters:
      payload - the text message payload

      Note 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

      public void onWebSocketPartialBinary(ByteBuffer payload, boolean fin, Callback callback)
      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 the callback is completed.

      Specified by:
      onWebSocketPartialBinary in interface Session.Listener
      Parameters:
      payload - the BINARY frame payload
      fin - whether this is the last frame
      callback - the callback to complete when the payload has been processed