Interface WebsocketConnectionListener

All Known Subinterfaces:
WebsocketClientListener
All Known Implementing Classes:
WebsocketRouter

public interface WebsocketConnectionListener
Interface to receive websocket connection events.
Since:
1.0
Version:
2022-08-30
  • Method Details

    • onConnect

      void onConnect(WebsocketConnection conn) throws Exception
      Called when a client connects to the server.
      Parameters:
      conn - the new connection
      Throws:
      Exception
    • onDisconnect

      void onDisconnect(WebsocketConnection conn) throws Exception
      Called when a client disconnects from the server.
      Parameters:
      conn - the connection that closed
      Throws:
      Exception
    • onError

      default void onError(WebsocketConnection conn) throws Exception
      Called when a client has an error. This may precede a close event for an open weboscket or may occur in isolation if the websocket never opened (such as server doesn't exit).
      Parameters:
      conn - the connection that had an error
      Throws:
      Exception