java.lang.Object
net.i2p.client.streaming.impl.ConnectionHandler.SynEntry
- Enclosing class:
ConnectionHandler
Accept-queue bookkeeping for one enqueued SYN.
Holds the enqueue clock-time and the accept-timeout snapshot taken at that moment. The timeout is snapshotted because the adaptive ConnectionHandler.getEffectiveAcceptTimeout() moves as tunnel health changes; the expiry must match what the client was quoted, not what health looks like later. A worker that polls the SYN stores a fresh record, so expiry keeps tracking the most recent quote.
Field Summary
FieldsModifier and TypeFieldDescription(package private) final longClock time, in ms since the epoch, when this SYN was enqueued.(package private) final intAccept window, in ms, snapshotted from the adaptive timeout at enqueue time.Constructor Summary
ConstructorsConstructorDescriptionSynEntry(long enqueuedMs, int timeoutMs) Records one enqueued SYN against the accept window that was quoted to the client.Method Summary
All MethodsModifier and TypeMethodDescription(package private) booleanexpired(long now) Tests whether this SYN has waited out its accept window.
Field Details
enqueuedMs
final long enqueuedMsClock time, in ms since the epoch, when this SYN was enqueued.timeoutMs
final int timeoutMsAccept window, in ms, snapshotted from the adaptive timeout at enqueue time.
Constructor Details
SynEntry
SynEntry(long enqueuedMs, int timeoutMs) Records one enqueued SYN against the accept window that was quoted to the client.- Parameters:
enqueuedMs- clock time, in ms since the epoch, when the SYN was enqueuedtimeoutMs- accept window in ms, snapshotted from the adaptive timeout
Method Details
expired
boolean expired(long now) Tests whether this SYN has waited out its accept window.- Parameters:
now- current clock time in ms since the epoch- Returns:
- true once the accept window has fully elapsed