public class Listener
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Listener.LagListener
Delays the notification of the wrapped listener to simulate lag on incoming objects.
|
static class |
Listener.QueuedListener
Wraps a listener and queues notifications as
runnables . |
static class |
Listener.ReflectionListener
Uses reflection to called "received(Connection, XXX)" on the listener, where XXX is the received object type.
|
static class |
Listener.ThreadedListener
Wraps a listener and processes notification events on a separate thread.
|
Constructor and Description |
---|
Listener() |
Modifier and Type | Method and Description |
---|---|
void |
connected(Connection connection)
Called when the remote end has been connected.
|
void |
disconnected(Connection connection)
Called when the remote end is no longer connected.
|
void |
idle(Connection connection)
Called when the connection is below the
idle threshold . |
void |
received(Connection connection,
java.lang.Object object)
Called when an object has been received from the remote end of the connection.
|
public void connected(Connection connection)
received(Connection, Object)
. This will be invoked on the same thread as Client.update(int)
and
Server.update(int)
. This method should not block for long periods as other network activity will not be processed
until it returns.public void disconnected(Connection connection)
public void received(Connection connection, java.lang.Object object)
Client.update(int)
and Server.update(int)
. This method should not block for long periods as other network
activity will not be processed until it returns.public void idle(Connection connection)
idle threshold
.