Interface WebsocketConnection

All Superinterfaces:
AttributeAware

public interface WebsocketConnection extends AttributeAware
Interface for a websocket connection.
Since:
1.0
Version:
2022-08-30
  • Method Details

    • getId

      String getId()
      Return the connection id.
      Returns:
      the unique connection id
    • sendMessage

      void sendMessage(String msg)
      Send a message to the associated client.
      Parameters:
      msg - the message to send
    • close

      void close()
      Close the connection.
    • getRemoteAddr

      InetSocketAddress getRemoteAddr()
      Return the client ip address for the websocket.
      Returns:
      the client address
    • getMsgHandler

      WebsocketMsgHandler getMsgHandler()
      Return the registered message handler.
    • setMsgHandler

      void setMsgHandler(WebsocketMsgHandler handler)
      Set the message handler to use for incoming messages.