Module bus.http

Interface WebSocketReader.FrameCallback

All Known Implementing Classes:
RealWebSocket
Enclosing class:
WebSocketReader

public static interface WebSocketReader.FrameCallback
A callback interface for WebSocket frame events.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onReadClose(int code, String reason)
    Invoked when a close frame is received.
    void
    Invoked when a text message is received.
    void
    onReadMessage(org.miaixz.bus.core.io.ByteString bytes)
    Invoked when a binary message is received.
    void
    onReadPing(org.miaixz.bus.core.io.ByteString buffer)
    Invoked when a ping frame is received.
    void
    onReadPong(org.miaixz.bus.core.io.ByteString buffer)
    Invoked when a pong frame is received.
  • Method Details

    • onReadMessage

      void onReadMessage(String text) throws IOException
      Invoked when a text message is received.
      Parameters:
      text - The text content.
      Throws:
      IOException - if an error occurs during processing.
    • onReadMessage

      void onReadMessage(org.miaixz.bus.core.io.ByteString bytes) throws IOException
      Invoked when a binary message is received.
      Parameters:
      bytes - The binary content.
      Throws:
      IOException - if an error occurs during processing.
    • onReadPing

      void onReadPing(org.miaixz.bus.core.io.ByteString buffer)
      Invoked when a ping frame is received.
      Parameters:
      buffer - The ping payload.
    • onReadPong

      void onReadPong(org.miaixz.bus.core.io.ByteString buffer)
      Invoked when a pong frame is received.
      Parameters:
      buffer - The pong payload.
    • onReadClose

      void onReadClose(int code, String reason)
      Invoked when a close frame is received.
      Parameters:
      code - The close code.
      reason - The close reason.