Module bus.http

Interface WebSocketReader.FrameCallback

All Known Implementing Classes:
RealWebSocket
Enclosing class:
WebSocketReader

public static interface WebSocketReader.FrameCallback
WebSocket 帧回调接口
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onReadClose(int code, String reason)
    接收 close 帧
    void
    接收文本消息
    void
    onReadMessage(org.miaixz.bus.core.io.ByteString bytes)
    接收二进制消息
    void
    onReadPing(org.miaixz.bus.core.io.ByteString buffer)
    接收 ping 帧
    void
    onReadPong(org.miaixz.bus.core.io.ByteString buffer)
    接收 pong 帧
  • Method Details

    • onReadMessage

      void onReadMessage(String text) throws IOException
      接收文本消息
      Parameters:
      text - 文本内容
      Throws:
      IOException - 如果处理失败
    • onReadMessage

      void onReadMessage(org.miaixz.bus.core.io.ByteString bytes) throws IOException
      接收二进制消息
      Parameters:
      bytes - 二进制内容
      Throws:
      IOException - 如果处理失败
    • onReadPing

      void onReadPing(org.miaixz.bus.core.io.ByteString buffer)
      接收 ping 帧
      Parameters:
      buffer - ping 数据
    • onReadPong

      void onReadPong(org.miaixz.bus.core.io.ByteString buffer)
      接收 pong 帧
      Parameters:
      buffer - pong 数据
    • onReadClose

      void onReadClose(int code, String reason)
      接收 close 帧
      Parameters:
      code - 关闭代码
      reason - 关闭原因