Class WebSocketChannelClient

java.lang.Object
com.flashphoner.fpwcsapi.ws.WebSocketChannelClient

public class WebSocketChannelClient extends Object
Implementation of Websocket client
  • Constructor Details

  • Method Details

    • getState

      public com.flashphoner.fpwcsapi.ws.WebSocketChannelClient.WebSocketConnectionState getState()
    • connect

      public void connect(SessionOptions sessionOptions)
      Connect passed wsUrl with default timeout 4000 ms
      Parameters:
      sessionOptions -
    • addCustomHeader

      public void addCustomHeader(Map<String,String> customHeaders)
    • execute

      public void execute(String command)
      Execute a Websocket command. Example: webSocketChannelClient.execute("pong");
      Parameters:
      command -
    • execute

      public void execute(String command, Object data)
      Execute a Websocket command.
      Parameters:
      command - name of the command
      data - object passed to the Websocket command
    • disconnect

      public void disconnect(boolean waitForComplete)
      Disconnect current Websocket session
      Parameters:
      waitForComplete - if true, waiting for closeEvent @see WebSocketChannelClient#onClose