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
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDelays the notification of the wrapped listener to simulate lag on incoming objects.static classWraps a listener and queues notifications asrunnables.static classWraps a listener and processes notification events on a separate thread. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidconnected(Connection connection) Called when the remote end has been connected.default voiddisconnected(Connection connection, DcReason reason) Called when the remote end is no longer connected.default voididle(Connection connection) Called when the connection is below theidle threshold.default voidreceived(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.
-