java.lang.Object
net.i2p.util.SimpleTimer2.TimedEvent
net.i2p.router.transport.udp.UDPTransport.ExpirePeerEvent
- All Implemented Interfaces:
Runnable
- Enclosing class:
UDPTransport
Timer expiring idle peers and pinging the rest.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanTrue while the timer should keep rescheduling.Scratch list for the peers examined each loop.private booleanTrue if the last loop used the short interval.private intLoops run since the transport started.Fields inherited from class SimpleTimer2.TimedEvent
_state, DEFAULT_FUZZModifier and TypeFieldDescriptionprotected SimpleTimer2.TimedEventStateState of the current event.protected static final intDefault fuzz threshold in milliseconds.Constructor Summary
ConstructorsMethod Summary
All MethodsMethods inherited from class SimpleTimer2.TimedEvent
cancel, forceReschedule, reschedule, reschedule, run, schedule, setFuzz, setPool, toStringModifier and TypeMethodDescriptionbooleancancel()Cancel the timed event.voidforceReschedule(long timeoutMs) Always use the new time - ignores fuzz.voidreschedule(long timeoutMs) Use the earliest of the new time and the old time May be called from within timeReached(), but schedule() is better there.voidreschedule(long timeoutMs, boolean useEarliestTime) May be called from within timeReached(), but schedule() is better there.voidrun()voidschedule(long timeoutMs) Schedule this event.voidsetFuzz(int fuzz) Reschedule threshold in ms.voidsetPool(SimpleTimer2 pool) Timer pool for this event.toString()Timer summary for log messages.
Field Details
_expireBuffer
_alive
private volatile boolean _aliveTrue while the timer should keep rescheduling._runCount
private int _runCountLoops run since the transport started._lastLoopShort
private boolean _lastLoopShortTrue if the last loop used the short interval.
Constructor Details
ExpirePeerEvent
public ExpirePeerEvent()Expire peer event.
Method Details
timeReached
setIsAlive
public void setIsAlive(boolean isAlive) Alive flag.- Parameters:
isAlive- true to mark the job alive and reschedule it at the long loop time, false to let it wind down