com.esotericsoftware.kryonet
Class Listener.ReflectionListener
java.lang.Object
com.esotericsoftware.kryonet.Listener
com.esotericsoftware.kryonet.Listener.ReflectionListener
- Enclosing class:
- Listener
public static class Listener.ReflectionListener
- extends Listener
Uses reflection to called "received(Connection, XXX)" on the listener, where XXX is the received object type. Note this
class uses a HashMap lookup and (cached) reflection, so is not as efficient as writing a series of "instanceof" statements.
Method Summary |
void |
received(Connection connection,
java.lang.Object object)
Called when an object has been received from the remote end of the connection. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Listener.ReflectionListener
public Listener.ReflectionListener()
received
public void received(Connection connection,
java.lang.Object object)
- Description copied from class:
Listener
- Called when an object has been received from the remote end of the connection. 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.
- Overrides:
received
in class Listener