java.lang.Object
net.i2p.util.SimpleTimer2.TimedEvent
net.i2p.router.tunnel.pool.TunnelPoolManager.ConditionalOutboundStartup
All Implemented Interfaces:
Runnable
Enclosing class:
TunnelPoolManager

private static class TunnelPoolManager.ConditionalOutboundStartupextends SimpleTimer2.TimedEvent
Conditionally start the outbound pool after the inbound pool has at least one tunnel. Retries every 2s; after max attempts, starts unconditionally. This prevents "Destination not reachable (no LeaseSet found)" at startup.
  • Field Details

    • outbound

      private final TunnelPool outbound
      The outbound pool being waited on.
    • inbound

      private final TunnelPool inbound
      The inbound pool paired with it.
    • _mgr

      private final TunnelPoolManager _mgr
      The manager owning the pools.
    • _dest

      private final Hash _dest
      The client's destination.
    • maxAttempts

      private final int maxAttempts
      Tries allowed before giving up.
    • _cancelled

      private volatile boolean _cancelled
      Set to stop waiting early.
    • attempts

      private int attempts
      Tries made so far.
  • Constructor Details

    • ConditionalOutboundStartup

      public ConditionalOutboundStartup(TunnelPool out, TunnelPool in, TunnelPoolManager mgr, RouterContext context, Hash dest)
      Schedule a startup that is abandoned unless the pools are ready in time.
      Parameters:
      out - the outbound pool to start
      in - the inbound pool to wait for
      mgr - the pool manager
      context - the router context
      dest - the client's destination hash
  • Method Details

    • cancelStartup

      public void cancelStartup()
      Cancel this pending startup, if it hasn't fired yet.
    • timeReached

      public void timeReached()
      Start the outbound pool when inbound has tunnels or attempts are exhausted.
      Specified by:
      timeReached in class SimpleTimer2.TimedEvent