Class WebSocketConnectionManager

java.lang.Object
marauroa.server.net.web.WebSocketConnectionManager
All Implemented Interfaces:
ConnectionManager

public class WebSocketConnectionManager extends Object implements ConnectionManager
a network manager implementation that uses a websocket server for web based clients.
Author:
hendrik
  • Method Details

    • onDisconnect

      public void onDisconnect(WebSocketChannel webSocketChannel)
      a client disconnected
      Parameters:
      webSocketChannel - channel to the client
    • onMessage

      public void onMessage(WebSocketChannel webSocketChannel, String message)
      a client sent a message
      Parameters:
      webSocketChannel - channel to the client
      message - message
    • finish

      public void finish()
      Description copied from interface: ConnectionManager
      shuts the server down
      Specified by:
      finish in interface ConnectionManager
    • isFinished

      public boolean isFinished()
      Description copied from interface: ConnectionManager
      was the server shutdown?
      Specified by:
      isFinished in interface ConnectionManager
      Returns:
      true, if the server was shut down; false otherwise
    • send

      public void send(Object internalChannel, Message msg, boolean isPerceptionRequired)
      Description copied from interface: ConnectionManager
      sends a message
      Specified by:
      send in interface ConnectionManager
      Parameters:
      internalChannel - channel to send the message to
      msg - message to send
      isPerceptionRequired - is the next perception unskipable?
    • close

      public void close(Object internalChannel)
      Description copied from interface: ConnectionManager
      closes a channel
      Specified by:
      close in interface ConnectionManager
      Parameters:
      internalChannel - channel to close