Interface WebSocket


public interface WebSocket
Author:
Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com), GraviteeSource Team
  • Method Summary

    Modifier and Type
    Method
    Description
    io.reactivex.rxjava3.core.Completable
    Closes the websocket without any status.
    io.reactivex.rxjava3.core.Completable
    close(int status)
    Closes the websocket with the specified status.
    io.reactivex.rxjava3.core.Completable
    close(int status, String reason)
    Closes the websocket with the specified status and reason.
    boolean
    Indicates if websocket is closed or not.
    io.reactivex.rxjava3.core.Flowable<Buffer>
    Returns the websocket incoming Flowable of Buffer.
    io.reactivex.rxjava3.core.Single<WebSocket>
    Upgrades the associated http request to websocket and returns the same instance once the upgrade has been performed.
    boolean
    Indicates if the http request has already been upgraded to websocket or not.
    io.reactivex.rxjava3.core.Completable
    write(Buffer buffer)
    Writes the buffer to the websocket as a binary frame.
    io.reactivex.rxjava3.core.Completable
    Writes a ping frame to the connection.
  • Method Details

    • upgrade

      io.reactivex.rxjava3.core.Single<WebSocket> upgrade()
      Upgrades the associated http request to websocket and returns the same instance once the upgrade has been performed.
      Returns:
      a Single of the same WebSocket instance once the upgrade performed.
    • write

      io.reactivex.rxjava3.core.Completable write(Buffer buffer)
      Writes the buffer to the websocket as a binary frame.
      Parameters:
      buffer - the buffer to write.
      Returns:
      a Completable that completes once writing has been performed.
    • writePing

      io.reactivex.rxjava3.core.Completable writePing()
      Writes a ping frame to the connection.

      This method should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 Section section 5.5.2.

      Returns:
      a Completable that completes once writing has been performed.
    • read

      io.reactivex.rxjava3.core.Flowable<Buffer> read()
      Returns the websocket incoming Flowable of Buffer.
      Returns:
      a Flowable of Buffer.
    • close

      io.reactivex.rxjava3.core.Completable close()
      Closes the websocket without any status.
      Returns:
      a Completable that completes once the close has been performed.
    • close

      io.reactivex.rxjava3.core.Completable close(int status)
      Closes the websocket with the specified status.
      Returns:
      a Completable that completes once the close has been performed.
    • close

      io.reactivex.rxjava3.core.Completable close(int status, String reason)
      Closes the websocket with the specified status and reason.
      Returns:
      a Completable that completes once the close has been performed.
    • upgraded

      boolean upgraded()
      Indicates if the http request has already been upgraded to websocket or not.
      Returns:
      true if it has been upgraded, false otherwise.
      See Also:
    • closed

      boolean closed()
      Indicates if websocket is closed or not.
      Returns:
      true if it is already closed, false otherwise.
      See Also: