Package arc.net
Class DispatchListener
java.lang.Object
arc.net.DispatchListener
- All Implemented Interfaces:
NetListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface arc.net.NetListener
NetListener.LagListener, NetListener.QueuedListener, NetListener.ThreadedListener -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanWhetheridle(Connection)calls stop if the connection has stopped to be idle.protected NetListener[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(NetListener listener) voidconnected(Connection connection) Called when the remote end has been connected.voiddisconnected(Connection connection, DcReason reason) Called when the remote end is no longer connected.voididle(Connection connection) Called when the connection is below theidle threshold.voidreceived(Connection connection, Object object) Called when an object has been received from the remote end of the connection.voidremoveListener(NetListener listener)
-
Field Details
-
listeners
-
cutIdle
public boolean cutIdleWhetheridle(Connection)calls stop if the connection has stopped to be idle.
-
-
Constructor Details
-
DispatchListener
public DispatchListener() -
DispatchListener
public DispatchListener(boolean cutIdle)
-
-
Method Details
-
getListeners
-
addListener
-
removeListener
-
connected
Description copied from interface:NetListenerCalled when the remote end has been connected. This will be invoked before any objects are received byNetListener.received(Connection, Object). This will be invoked on the same thread asClient.update(int)andServer.update(int). This method should not block for long periods as other network activity will not be processed until it returns.- Specified by:
connectedin interfaceNetListener
-
disconnected
Description copied from interface:NetListenerCalled when the remote end is no longer connected. There is no guarantee as to what thread will invoke this method.- Specified by:
disconnectedin interfaceNetListener
-
received
Description copied from interface:NetListenerCalled when an object has been received from the remote end of the connection. This will be invoked on the same thread asClient.update(int)andServer.update(int). This method should not block for long periods as other network activity will not be processed until it returns.- Specified by:
receivedin interfaceNetListener
-
idle
Description copied from interface:NetListenerCalled when the connection is below theidle threshold.- Specified by:
idlein interfaceNetListener
-