Interface IServerManager

All Known Implementing Classes:
NetworkServerManager

public interface IServerManager
This interface allows ConnectionManagers to talk to the central server manager.
Author:
miguel
  • Method Details

    • addServer

      void addServer(ConnectionManager server)
      Adds a server to the worker
      Parameters:
      server - IServer
    • onConnect

      Channel onConnect(ConnectionManager server, InetSocketAddress address, Object internalChannel)
      This is a callback method that is called onConnect
      Parameters:
      server - IServer
      address - of the client
      internalChannel - internal channel object
      Returns:
      the channel, if the connection was accepted; null otherwise
    • onMessage

      void onMessage(ConnectionManager server, Object internalChannel, Message message)
      This method is called when data is received from a socket channel
      Parameters:
      server - ConnectionManager
      internalChannel - internal channel object
      message - a Message
    • onDisconnect

      void onDisconnect(ConnectionManager server, Object internalChannel)
      This method is called when the client is disconnected
      Parameters:
      server - ConnectionManager
      internalChannel - internal channel object
    • registerDisconnectedListener

      void registerDisconnectedListener(IDisconnectedListener listener)
      Register a listener for disconnection events.
      Parameters:
      listener - a listener for disconnection events.