Class JSR356WebSocket

All Implemented Interfaces:
AsyncIOWriter, KeepOpenStreamAware

public class JSR356WebSocket extends WebSocket
Asynchronous based Session websocket
  • Constructor Details

  • Method Details

    • isOpen

      public boolean isOpen()
      Description copied from class: WebSocket
      Is the underlying WebSocket open.
      Specified by:
      isOpen in class WebSocket
      Returns:
      true is opened
    • write

      public WebSocket write(String s) throws IOException
      Description copied from class: WebSocket
      Use the underlying container's websocket to write the String.
      Specified by:
      write in class WebSocket
      Parameters:
      s - a websocket String message
      Returns:
      this
      Throws:
      IOException
    • write

      public WebSocket write(byte[] data, int offset, int length) throws IOException
      Description copied from class: WebSocket
      Use the underlying container's websocket to write the byte.
      Specified by:
      write in class WebSocket
      Parameters:
      data - a websocket byte message
      offset - start
      length - end
      Returns:
      this
      Throws:
      IOException
    • close

      public void close()
      Description copied from class: WebSocket
      Close the underlying WebSocket
      Specified by:
      close in class WebSocket
    • close

      public void close(int statusCode, String reasonText)
      Description copied from class: WebSocket
      Allow the underlying WebSocket to close with a code and a reason. The base implementation closes the socket without transmitting the code and reason — bindings whose native API can carry them override this. It must never silently leave the connection open.
      Overrides:
      close in class WebSocket
    • sendPing

      public WebSocket sendPing(byte[] payload)
      Description copied from class: WebSocket
      Send a WebSocket Ping. Supported by the JSR356 binding (every servlet container); bindings whose native API has no control-frame access throw UnsupportedOperationException.
      Overrides:
      sendPing in class WebSocket
      Parameters:
      payload - the bytes to send
      Returns:
      this
    • sendPong

      public WebSocket sendPong(byte[] payload)
      Description copied from class: WebSocket
      Send a WebSocket Pong. Supported by the JSR356 binding (every servlet container); bindings whose native API has no control-frame access throw UnsupportedOperationException.
      Overrides:
      sendPong in class WebSocket
      Parameters:
      payload - the bytes to send
      Returns:
      this