Class SeedingUnchoker

  • All Implemented Interfaces:
    Unchoker

    public class SeedingUnchoker
    extends java.lang.Object
    implements Unchoker
    Unchoker implementation to be used while in seeding mode.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SeedingUnchoker()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void calculateUnchokes​(int max_to_unchoke, java.util.ArrayList<PEPeer> all_peers, boolean force_refresh, boolean check_priority_connections, boolean do_high_latency_peers)
      Perform peer choke, unchoke and optimistic calculations
      java.util.ArrayList<PEPeer> getChokes()
      Get the list of peers calculated to be choked.
      java.util.ArrayList<PEPeer> getImmediateUnchokes​(int max_to_unchoke, java.util.ArrayList<PEPeer> all_peers)
      Get any unchokes that should be performed immediately.
      java.util.ArrayList<PEPeer> getUnchokes()
      Get the list of peers calculated to be unchoked.
      boolean isSeedingUnchoker()  
      private void setPriorityUnchokes​(int max_priority, java.util.ArrayList<PEPeer> all_peers)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • priority_unchoke_retention_count

        private static int priority_unchoke_retention_count
      • chokes

        private java.util.ArrayList<PEPeer> chokes
      • unchokes

        private java.util.ArrayList<PEPeer> unchokes
    • Constructor Detail

      • SeedingUnchoker

        protected SeedingUnchoker()
    • Method Detail

      • getImmediateUnchokes

        public java.util.ArrayList<PEPeer> getImmediateUnchokes​(int max_to_unchoke,
                                                                java.util.ArrayList<PEPeer> all_peers)
        Description copied from interface: Unchoker
        Get any unchokes that should be performed immediately.
        Specified by:
        getImmediateUnchokes in interface Unchoker
        Parameters:
        max_to_unchoke - maximum number of peers allowed to be unchoked
        all_peers - list of peers to choose from
        Returns:
        peers to unchoke
      • calculateUnchokes

        public void calculateUnchokes​(int max_to_unchoke,
                                      java.util.ArrayList<PEPeer> all_peers,
                                      boolean force_refresh,
                                      boolean check_priority_connections,
                                      boolean do_high_latency_peers)
        Description copied from interface: Unchoker
        Perform peer choke, unchoke and optimistic calculations
        Specified by:
        calculateUnchokes in interface Unchoker
        Parameters:
        max_to_unchoke - maximum number of peers allowed to be unchoked
        all_peers - list of peers to choose from
        force_refresh - force a refresh of optimistic unchokes
      • setPriorityUnchokes

        private void setPriorityUnchokes​(int max_priority,
                                         java.util.ArrayList<PEPeer> all_peers)
      • getChokes

        public java.util.ArrayList<PEPeer> getChokes()
        Description copied from interface: Unchoker
        Get the list of peers calculated to be choked.
        Specified by:
        getChokes in interface Unchoker
        Returns:
        peers to choke
      • getUnchokes

        public java.util.ArrayList<PEPeer> getUnchokes()
        Description copied from interface: Unchoker
        Get the list of peers calculated to be unchoked.
        Specified by:
        getUnchokes in interface Unchoker
        Returns:
        peers to unchoke