Package com.toxi.net

Class ServerListenerAdapter

java.lang.Object
com.toxi.net.ServerListenerAdapter
All Implemented Interfaces:
ServerListener

public class ServerListenerAdapter extends Object implements ServerListener
Author:
toxi
  • Constructor Details

    • ServerListenerAdapter

      public ServerListenerAdapter()
  • Method Details

    • clientConnected

      public void clientConnected(com.toxi.net.UDPConnection conn)
      Description copied from interface: ServerListener
      Notifies listener of a new client connection. Details are attached.
      Specified by:
      clientConnected in interface ServerListener
    • clientDisconnected

      public void clientDisconnected(com.toxi.net.UDPConnection conn)
      Description copied from interface: ServerListener
      Notifies listener a client has disconnected. Connection details are attached.
      Specified by:
      clientDisconnected in interface ServerListener
    • clientUpdated

      public void clientUpdated(com.toxi.net.UDPConnection conn, DatagramPacket receivePacket)
      Description copied from interface: ServerListener
      Notifies and forwards received client data to the listener for further analysis.
      Specified by:
      clientUpdated in interface ServerListener
      Parameters:
      conn - client connection details
      receivePacket - data sent by the client
    • getSyncPayload

      public byte[] getSyncPayload()
      Description copied from interface: ServerListener
      Gives the listener a chance to add extra data to the payload packet distributed to each client.
      Specified by:
      getSyncPayload in interface ServerListener
      Returns:
      additional data, or null if none required
    • serverError

      public void serverError(Exception e)
      Description copied from interface: ServerListener
      Gives listener a chance to react to any fatal server errors.
      Specified by:
      serverError in interface ServerListener
    • serverShutdown

      public void serverShutdown()
      Description copied from interface: ServerListener
      Notifies the listener server is shutting down.
      Specified by:
      serverShutdown in interface ServerListener
    • serverStarted

      public void serverStarted()
      Description copied from interface: ServerListener
      Notifies listener immediately after the server socket has been created.
      Specified by:
      serverStarted in interface ServerListener
    • serverStateChanged

      public void serverStateChanged(ServerState s)
      Description copied from interface: ServerListener
      Notifies the listener of a new server state. The state info itself is attached.
      Specified by:
      serverStateChanged in interface ServerListener