Class WebSocketChannel

java.lang.Object
marauroa.server.net.web.WebSocketChannel

public class WebSocketChannel extends Object
a websocket connection to a client
Author:
hendrik
  • Constructor Details

    • WebSocketChannel

      public WebSocketChannel()
  • Method Details

    • onOpen

      public void onOpen(jakarta.websocket.Session session, jakarta.websocket.EndpointConfig config)
    • onWebSocketText

      public void onWebSocketText(String message)
    • onClose

      public void onClose(jakarta.websocket.Session session, jakarta.websocket.CloseReason closeReason)
    • onError

      public void onError(jakarta.websocket.Session session, Throwable cause)
    • getAddress

      public InetSocketAddress getAddress()
      gets the ip-address and port
      Returns:
      address
    • getUsername

      public String getUsername()
      gets the username
      Returns:
      username
    • sendMessage

      public void sendMessage(String json)
      sends a message to the client
      Parameters:
      json - json string to send
    • close

      public void close()
      closes the websocket channel