Package com.toxi.net
Class ServerListenerAdapter
java.lang.Object
com.toxi.net.ServerListenerAdapter
- All Implemented Interfaces:
ServerListener
- Author:
- toxi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclientConnected(com.toxi.net.UDPConnection conn) Notifies listener of a new client connection.voidclientDisconnected(com.toxi.net.UDPConnection conn) Notifies listener a client has disconnected.voidclientUpdated(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.voidGives listener a chance to react to any fatal server errors.voidNotifies the listener server is shutting down.voidNotifies listener immediately after the server socket has been created.voidNotifies the listener of a new server state.
-
Constructor Details
-
ServerListenerAdapter
public ServerListenerAdapter()
-
-
Method Details
-
clientConnected
public void clientConnected(com.toxi.net.UDPConnection conn) Description copied from interface:ServerListenerNotifies listener of a new client connection. Details are attached.- Specified by:
clientConnectedin interfaceServerListener
-
clientDisconnected
public void clientDisconnected(com.toxi.net.UDPConnection conn) Description copied from interface:ServerListenerNotifies listener a client has disconnected. Connection details are attached.- Specified by:
clientDisconnectedin interfaceServerListener
-
clientUpdated
Description copied from interface:ServerListenerNotifies and forwards received client data to the listener for further analysis.- Specified by:
clientUpdatedin interfaceServerListener- Parameters:
conn- client connection detailsreceivePacket- data sent by the client
-
getSyncPayload
public byte[] getSyncPayload()Description copied from interface:ServerListenerGives the listener a chance to add extra data to the payload packet distributed to each client.- Specified by:
getSyncPayloadin interfaceServerListener- Returns:
- additional data, or null if none required
-
serverError
Description copied from interface:ServerListenerGives listener a chance to react to any fatal server errors.- Specified by:
serverErrorin interfaceServerListener
-
serverShutdown
public void serverShutdown()Description copied from interface:ServerListenerNotifies the listener server is shutting down.- Specified by:
serverShutdownin interfaceServerListener
-
serverStarted
public void serverStarted()Description copied from interface:ServerListenerNotifies listener immediately after the server socket has been created.- Specified by:
serverStartedin interfaceServerListener
-
serverStateChanged
Description copied from interface:ServerListenerNotifies the listener of a new server state. The state info itself is attached.- Specified by:
serverStateChangedin interfaceServerListener
-