Package com.toxi.net

Interface ServerListener

All Known Implementing Classes:
ServerListenerAdapter

public interface ServerListener
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    clientConnected(com.toxi.net.UDPConnection conn)
    Notifies listener of a new client connection.
    void
    clientDisconnected(com.toxi.net.UDPConnection conn)
    Notifies listener a client has disconnected.
    void
    clientUpdated(com.toxi.net.UDPConnection conn, DatagramPacket receivePacket)
    Notifies and forwards received client data to the listener for further analysis.
    byte[]
    Gives the listener a chance to add extra data to the payload packet distributed to each client.
    void
    Gives listener a chance to react to any fatal server errors.
    void
    Notifies the listener server is shutting down.
    void
    Notifies listener immediately after the server socket has been created.
    void
    Notifies the listener of a new server state.
  • Method Details

    • serverStarted

      void serverStarted()
      Notifies listener immediately after the server socket has been created.
    • serverShutdown

      void serverShutdown()
      Notifies the listener server is shutting down.
    • serverError

      void serverError(Exception e)
      Gives listener a chance to react to any fatal server errors.
      Parameters:
      e -
    • serverStateChanged

      void serverStateChanged(ServerState s)
      Notifies the listener of a new server state. The state info itself is attached.
      Parameters:
      s -
    • clientConnected

      void clientConnected(com.toxi.net.UDPConnection conn)
      Notifies listener of a new client connection. Details are attached.
      Parameters:
      conn -
    • clientDisconnected

      void clientDisconnected(com.toxi.net.UDPConnection conn)
      Notifies listener a client has disconnected. Connection details are attached.
      Parameters:
      conn -
    • clientUpdated

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

      byte[] getSyncPayload()
      Gives the listener a chance to add extra data to the payload packet distributed to each client.
      Returns:
      additional data, or null if none required