java.lang.Object
net.i2p.util.SimpleTimer2.TimedEvent
net.i2p.router.transport.udp.PeerTestManager.DelayTest
- All Implemented Interfaces:
Runnable
- Enclosing class:
PeerTestManager
Wait for RI.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intRelays already sent for this request.private final byte[]The relayed payload.private static final longDelay between relay retries.private final RemoteHostIdThe host the relay request came from.private final PeerState2The peer state of the requester.private final HashThe target peer's hash.private final intThe message type being relayed.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
ConstructorsConstructorDescriptionDelayTest(RemoteHostId f, PeerState2 fp, int m, Hash h, byte[] d) Schedules itself.Method 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
from
The host the relay request came from.fromPeer
The peer state of the requester.msg
private final int msgThe message type being relayed.hash
The target peer's hash.data
private final byte[] dataThe relayed payload.count
private volatile int countRelays already sent for this request.DELAY
Constructor Details
DelayTest
Schedules itself.- Parameters:
f- remote host id of the senderfp- peer state of the senderm- message number, 2 or 4h- hash of the RouterInfo awaitedd- signed peer test data to retry with
Method Details
timeReached
public void timeReached()Description copied from class:SimpleTimer2.TimedEventCalled when this event's scheduled time arrives. Must NOT block. For periodic events, call schedule(period) at the end to self-reschedule.- Specified by:
timeReachedin classSimpleTimer2.TimedEvent