java.lang.Object
net.i2p.router.tunnel.pool.ExcluderBase
net.i2p.router.tunnel.pool.TunnelPeerSelector.ClosestHopExcluder
All Implemented Interfaces:
Iterable<Hash>, Collection<Hash>, Set<Hash>
Enclosing class:
TunnelPeerSelector

private class TunnelPeerSelector.ClosestHopExcluderextends ExcluderBase
Excludes peers that cannot connect as closest hops. Used for hidden mode and other tough situations. Not for hidden inbound; use SANFP instead.
  • Field Details

    • isIn

      private final boolean isIn
      Whether the pass builds inbound tunnels.
    • ourMask

      private final int ourMask
      The hop position mask for this router.
  • Constructor Details

    • ClosestHopExcluder

      public ClosestHopExcluder(boolean isInbound, Set<Hash> set)
      Automatically check if peer can connect to us (for inbound) or we can connect to it (for outbound) and add the Hash to the set if not.
      Parameters:
      isInbound - true to check that the peer can connect to us, false to check that we can connect to it
      set - not copied, contents will be modified by all methods
  • Method Details

    • contains

      public boolean contains(Object o)
      Check if a peer should be excluded from closest hop selection. Automatically adds to the set if not connectable.
      Specified by:
      contains in interface Collection<Hash>
      Specified by:
      contains in interface Set<Hash>
      Specified by:
      contains in class ExcluderBase
      Parameters:
      o - a Hash object to check
      Returns:
      true if peer should be excluded (and added to set)