java.lang.Object
com.github.theword.queqiao.tool.websocket.WsClient

public class WsClient extends Object
Netty WebSocket 客户端。
  • Constructor Details

    • WsClient

      public WsClient(URI uri, org.slf4j.Logger logger, com.google.gson.Gson gson, String serverName, String accessToken, int reconnectMaxTimes, int reconnectInterval, boolean enabled)
  • Method Details

    • getURI

      public URI getURI()
    • isOpen

      public boolean isOpen()
    • connect

      public void connect()
      建立连接(首次启动调用)
    • send

      public void send(String message)
    • reconnectNow

      public void reconnectNow()
      立刻触发重连(命令触发)
    • stopWithoutReconnect

      public void stopWithoutReconnect(int code, String reason)
      停止并关闭连接,不再自动重连