Package arc.net
Interface NetListener
- All Known Implementing Classes:
InputStreamSender
,NetListener.LagListener
,NetListener.QueuedListener
,NetListener.ThreadedListener
,TcpIdleSender
public interface NetListener
Used to be notified about connection events.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Delays the notification of the wrapped listener to simulate lag on incoming objects.static class
Wraps a listener and queues notifications asrunnables
.static class
Wraps a listener and processes notification events on a separate thread. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
connected
(Connection connection) Called when the remote end has been connected.default void
disconnected
(Connection connection, DcReason reason) Called when the remote end is no longer connected.default void
idle
(Connection connection) Called when the connection is below theidle threshold
.default void
received
(Connection connection, Object object) Called when an object has been received from the remote end of the connection.
-
Method Details
-
connected
Called when the remote end has been connected. This will be invoked before any objects are received byreceived(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. -
disconnected
Called when the remote end is no longer connected. There is no guarantee as to what thread will invoke this method. -
received
Called 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. -
idle
Called when the connection is below theidle threshold
.
-