Class WebSocketDocs.ListenerEndPoint

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

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

    • ListenerEndPoint

      public ListenerEndPoint()
  • 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
    • onWebSocketText

      public void onWebSocketText(String message)
      Description copied from interface: Session.Listener

      A WebSocket TEXT message has been received.

      Specified by:
      onWebSocketText in interface Session.Listener
      Parameters:
      message - the text payload
    • onWebSocketBinary

      public void onWebSocketBinary(ByteBuffer payload, Callback callback)
      Description copied from interface: Session.Listener

      A WebSocket BINARY message has been received.

      Specified by:
      onWebSocketBinary in interface Session.Listener
      Parameters:
      payload - the raw payload array received
    • onWebSocketError

      public void onWebSocketError(Throwable cause)
      Description copied from interface: Session.Listener

      A WebSocket error has occurred during the processing of WebSocket frames.

      Usually errors occurs from bad or malformed incoming packets, for example text frames that do not contain UTF-8 bytes, frames that are too big, or other violations of the WebSocket specification.

      The WebSocket Session will be closed, but applications may explicitly close the Session providing a different status code or reason.

      Specified by:
      onWebSocketError in interface Session.Listener
      Parameters:
      cause - the error that occurred
    • onWebSocketClose

      public void onWebSocketClose(int statusCode, String reason)
      Description copied from interface: Session.Listener

      The WebSocket Session has been closed.

      Specified by:
      onWebSocketClose in interface Session.Listener
      Parameters:
      statusCode - the close status code
      reason - the optional reason for the close