类 WebSocketListener

java.lang.Object
com.lark.oapi.okhttp.WebSocketListener
直接已知子类:
Listener

public abstract class WebSocketListener extends Object
  • 构造器详细资料

    • WebSocketListener

      public WebSocketListener()
  • 方法详细资料

    • onOpen

      public void onOpen(WebSocket webSocket, Response response)
      Invoked when a web socket has been accepted by the remote peer and may begin transmitting messages.
    • onMessage

      public void onMessage(WebSocket webSocket, String text)
      Invoked when a text (type 0x1) message has been received.
    • onMessage

      public void onMessage(WebSocket webSocket, ByteString bytes)
      Invoked when a binary (type 0x2) message has been received.
    • onClosing

      public void onClosing(WebSocket webSocket, int code, String reason)
      Invoked when the remote peer has indicated that no more incoming messages will be transmitted.
    • onClosed

      public void onClosed(WebSocket webSocket, int code, String reason)
      Invoked when both peers have indicated that no more messages will be transmitted and the connection has been successfully released. No further calls to this listener will be made.
    • onFailure

      public void onFailure(WebSocket webSocket, Throwable t, @Nullable Response response)
      Invoked when a web socket has been closed due to an error reading from or writing to the network. Both outgoing and incoming messages may have been lost. No further calls to this listener will be made.