java.lang.Object
net.i2p.client.streaming.impl.ConnectionHandler.SynEntry
Enclosing class:
ConnectionHandler

static class ConnectionHandler.SynEntryextends Object
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

    Fields
    Modifier and Type
    Field
    Description
    (package private) final long
    Clock time, in ms since the epoch, when this SYN was enqueued.
    (package private) final int
    Accept window, in ms, snapshotted from the adaptive timeout at enqueue time.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SynEntry(long enqueuedMs, int timeoutMs)
    Records one enqueued SYN against the accept window that was quoted to the client.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    (package private) boolean
    expired(long now)
    Tests whether this SYN has waited out its accept window.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • enqueuedMs

      final long enqueuedMs
      Clock time, in ms since the epoch, when this SYN was enqueued.
    • timeoutMs

      final int timeoutMs
      Accept 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 enqueued
      timeoutMs - 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