|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aelitis.azureus.core.peermanager.unchoker.UnchokerUtil
public class UnchokerUtil
Utility collection for unchokers.
| Constructor Summary | |
|---|---|
UnchokerUtil()
|
|
| Method Summary | |
|---|---|
static void |
doHighLatencyPeers(java.util.ArrayList<PEPeer> peers_to_choke,
java.util.ArrayList<PEPeer> peers_to_unchoke,
boolean allow_snubbed)
|
static PEPeer |
getNextOptimisticPeer(java.util.ArrayList<PEPeer> all_peers,
boolean factor_reciprocated,
boolean allow_snubbed)
Choose the next peer, optimistically, that should be unchoked. |
static java.util.ArrayList<PEPeer> |
getNextOptimisticPeers(java.util.ArrayList<PEPeer> all_peers,
boolean factor_reciprocated,
boolean allow_snubbed,
int num_needed)
|
static boolean |
isUnchokable(PEPeer peer,
boolean allow_snubbed)
Test whether or not the given peer is allowed to be unchoked. |
static void |
performChokes(java.util.ArrayList<PEPeer> peers_to_choke,
java.util.ArrayList<PEPeer> peers_to_unchoke)
Send choke/unchoke messages to the given peers. |
static void |
performChokeUnchoke(PEPeer to_choke,
PEPeer to_unchoke)
|
static void |
updateLargestValueFirstSort(long new_value,
long[] values,
PEPeer new_item,
java.util.ArrayList items,
int start_pos)
Update (if necessary) the given list with the given value while maintaining a largest-value-first (as seen so far) sort order. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UnchokerUtil()
| Method Detail |
|---|
public static boolean isUnchokable(PEPeer peer,
boolean allow_snubbed)
peer - to testallow_snubbed - if true, ignore snubbed state
public static void updateLargestValueFirstSort(long new_value,
long[] values,
PEPeer new_item,
java.util.ArrayList items,
int start_pos)
new_value - to usevalues - existing values arraynew_item - to insertitems - existing itemsstart_pos - index at which to start compare
public static PEPeer getNextOptimisticPeer(java.util.ArrayList<PEPeer> all_peers,
boolean factor_reciprocated,
boolean allow_snubbed)
all_peers - list of peer to choose fromfactor_reciprocated - if true, factor in how much (if any) this peer has reciprocated when choosingallow_snubbed - allow the picking of snubbed-state peers as last resort
public static java.util.ArrayList<PEPeer> getNextOptimisticPeers(java.util.ArrayList<PEPeer> all_peers,
boolean factor_reciprocated,
boolean allow_snubbed,
int num_needed)
public static void performChokes(java.util.ArrayList<PEPeer> peers_to_choke,
java.util.ArrayList<PEPeer> peers_to_unchoke)
peers_to_choke - peers_to_unchoke -
public static void performChokeUnchoke(PEPeer to_choke,
PEPeer to_unchoke)
public static void doHighLatencyPeers(java.util.ArrayList<PEPeer> peers_to_choke,
java.util.ArrayList<PEPeer> peers_to_unchoke,
boolean allow_snubbed)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||