Interface WebSockets.SocketListener

All Known Implementing Classes:
WebSocketStreamHandler
Enclosing class:
WebSockets

public static interface WebSockets.SocketListener
A simple interface for a listener on a web socket
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when a binary media type message is received
    void
    Called when the stream is closed.
    void
    Called when there has been a failure
    void
    open(String protocol, okhttp3.WebSocket socket)
    Called when the socket is opened
    void
    Called when a text media type message is received
  • Method Details

    • open

      void open(String protocol, okhttp3.WebSocket socket)
      Called when the socket is opened
    • bytesMessage

      void bytesMessage(InputStream in)
      Called when a binary media type message is received
      Parameters:
      in - The input stream containing the binary data
    • textMessage

      void textMessage(Reader in)
      Called when a text media type message is received
      Parameters:
      in - The character stream containing the message
    • failure

      void failure(Throwable t)
      Called when there has been a failure
      Parameters:
      t - the exception associated with the failure.
    • close

      void close()
      Called when the stream is closed.