java.lang.Object
net.i2p.util.SimpleTimer2.TimedEvent
net.i2p.router.transport.udp.PeerTestManager.ContinueTimer
- All Implemented Interfaces:
Runnable
- Enclosing class:
PeerTestManager
SSU 1 or 2. We are Alice.
Field Summary
FieldsFields 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 MethodsModifier and TypeMethodDescriptionvoidDecide what to do under the instance lock, then send outside it.Methods 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
_nonce
private final long _nonceThe nonce of the current test.
Constructor Details
ContinueTimer
public ContinueTimer(long nonce) Schedules itself.- Parameters:
nonce- the peer test to continue when the timer fires
Method Details
timeReached
public void timeReached()Decide what to do under the instance lock, then send outside it.The decision reads and clears _currentTest, so it needs the lock. The send builds a packet and can block, and holding the lock across that would stall runTest() and every receiveTest() path. The state captured under the lock is passed to the send explicitly.
- Specified by:
timeReachedin classSimpleTimer2.TimedEvent