Class TRTrackerServerTorrentImpl
java.lang.Object
com.biglybt.core.tracker.server.impl.TRTrackerServerTorrentImpl
- All Implemented Interfaces:
TRTrackerServerTorrent
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classprotected static classprotected static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LinkedHashMapprivate intprivate Listprivate booleanstatic final bytestatic final bytestatic final bytestatic final bytestatic final byteprivate booleanprivate byte[]private byteprivate booleanprivate Listprivate intprivate final HashWrapperprivate intprivate booleanprivate Mapprivate longprivate final Mapprivate final Listprivate static final LogIDsprivate booleanstatic final intstatic final intstatic final intprivate intstatic final intprivate List<TRTrackerServerPeerImpl> private booleanprivate intprivate Listprivate Map<HashWrapper, TRTrackerServerPeerImpl> private Map<String, TRTrackerServerPeerImpl> private LinkedListprivate static final intprivate static final intprivate static final intprivate final Randomprivate URL[]private intprivate intprivate final TRTrackerServerImplprivate final TRTrackerServerTorrentStatsImplprotected final AEMonitorstatic final boolean -
Constructor Summary
ConstructorsConstructorDescriptionTRTrackerServerTorrentImpl(TRTrackerServerImpl _server, HashWrapper _hash, boolean _enabled) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExplicitBiasedPeer(String ip, int port) voidvoidprotected voidcheckForPeerListCompaction(boolean force) protected voidprotected voiddelete()voidexportAnnounceToMap(String ip_address, HashMap preprocess_map, TRTrackerServerPeerImpl requesting_peer, boolean include_seeds, int num_want, long interval, long min_interval, boolean no_peer_id, byte compact_mode, byte crypto_level, DHTNetworkPosition network_position) private voidexportPeer(LinkedList rep_peers, TRTrackerServerSimplePeer peer, boolean send_peer_ids, byte compact_mode, byte crypto_level, DHTNetworkPosition network_position) exportScrapeToMap(String url_parameters, String ip_address, boolean allow_cache) intgetHash()protected intprotected intgetPeers()protected intURL[]protected intprotected intgetSeedCountForScrape(boolean requester_is_biased) getStats()protected voidhandleRedirects(String url_parameters, String real_ip_address, boolean scrape) voidimportPeers(List peers) booleanbooleanpeerContact(String url_parameters, String event, HashWrapper peer_id, int tcp_port, int udp_port, int http_port, byte crypto_level, byte az_ver, String original_address, String ip_address, boolean ip_override, boolean loopback, String tracker_key, long uploaded, long downloaded, long left, long interval_requested, int up_speed, DHTNetworkPosition network_position) protected voidpeerEvent(TRTrackerServerPeer peer, int event, String url_parameters) voidpeerQueued(String ip, int tcp_port, int udp_port, int http_port, byte crypto_level, byte az_ver, long timeout_secs, boolean seed) voidvoidremoveLink(String link) voidprotected voidremovePeer(TRTrackerServerPeerImpl peer, int peer_list_index, int reason, String url_parameters) protected voidremovePeer(TRTrackerServerPeerImpl peer, int reason, String url_parameters) voidvoidsetEnabled(boolean _enabled) voidsetMinBiasedPeers(int num) voidsetRedirects(URL[] urls) protected voidupdateBiasedPeers(Set biased_peers_set) protected voidupdateXferStats(int bytes_in, int bytes_out)
-
Field Details
-
LOGID
-
MIN_CACHE_ENTRY_SIZE
public static final int MIN_CACHE_ENTRY_SIZE- See Also:
-
MAX_UPLOAD_BYTES_PER_SEC
public static final int MAX_UPLOAD_BYTES_PER_SEC- See Also:
-
MAX_DOWNLOAD_BYTES_PER_SEC
public static final int MAX_DOWNLOAD_BYTES_PER_SEC- See Also:
-
USE_LIGHTWEIGHT_SEEDS
public static final boolean USE_LIGHTWEIGHT_SEEDS- See Also:
-
MAX_IP_OVERRIDE_PEERS
public static final int MAX_IP_OVERRIDE_PEERS- See Also:
-
COMPACT_MODE_NONE
public static final byte COMPACT_MODE_NONE- See Also:
-
COMPACT_MODE_NORMAL
public static final byte COMPACT_MODE_NORMAL- See Also:
-
COMPACT_MODE_AZ
public static final byte COMPACT_MODE_AZ- See Also:
-
COMPACT_MODE_AZ_2
public static final byte COMPACT_MODE_AZ_2- See Also:
-
COMPACT_MODE_XML
public static final byte COMPACT_MODE_XML- See Also:
-
QUEUED_PEERS_MAX_SWARM_SIZE
private static final int QUEUED_PEERS_MAX_SWARM_SIZE- See Also:
-
QUEUED_PEERS_MAX
private static final int QUEUED_PEERS_MAX- See Also:
-
QUEUED_PEERS_ADD_MAX
private static final int QUEUED_PEERS_ADD_MAX- See Also:
-
server
-
hash
-
peer_map
-
peer_reuse_map
-
peer_list
-
peer_list_hole_count
private int peer_list_hole_count -
peer_list_compaction_suspended
private boolean peer_list_compaction_suspended -
biased_peers
-
min_biased_peers
private int min_biased_peers -
lightweight_seed_map
-
seed_count
private int seed_count -
removed_count
private int removed_count -
ip_override_count
private int ip_override_count -
bad_NAT_count
private int bad_NAT_count -
random
-
last_scrape_calc_time
private long last_scrape_calc_time -
last_scrape
-
announce_cache
-
stats
-
listeners
-
peer_listeners
-
deleted
private boolean deleted -
enabled
private boolean enabled -
map_size_diff_reported
private boolean map_size_diff_reported -
ip_override_limit_exceeded_reported
private boolean ip_override_limit_exceeded_reported -
duplicate_peer_checker_index
private byte duplicate_peer_checker_index -
duplicate_peer_checker
private byte[] duplicate_peer_checker -
redirects
-
caching_enabled
private boolean caching_enabled -
queued_peers
-
this_mon
-
explicit_manual_biased_peers
-
explicit_next_peer
private int explicit_next_peer
-
-
Constructor Details
-
TRTrackerServerTorrentImpl
-
-
Method Details
-
setEnabled
public void setEnabled(boolean _enabled) - Specified by:
setEnabledin interfaceTRTrackerServerTorrent
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceTRTrackerServerTorrent
-
setMinBiasedPeers
public void setMinBiasedPeers(int num) - Specified by:
setMinBiasedPeersin interfaceTRTrackerServerTorrent
-
importPeers
- Specified by:
importPeersin interfaceTRTrackerServerTorrent
-
peerContact
public TRTrackerServerPeerImpl peerContact(String url_parameters, String event, HashWrapper peer_id, int tcp_port, int udp_port, int http_port, byte crypto_level, byte az_ver, String original_address, String ip_address, boolean ip_override, boolean loopback, String tracker_key, long uploaded, long downloaded, long left, long interval_requested, int up_speed, DHTNetworkPosition network_position) throws TRTrackerServerException - Throws:
TRTrackerServerException
-
peerQueued
public void peerQueued(String ip, int tcp_port, int udp_port, int http_port, byte crypto_level, byte az_ver, long timeout_secs, boolean seed) -
remove
- Specified by:
removein interfaceTRTrackerServerTorrent
-
removePeer
-
removePeer
protected void removePeer(TRTrackerServerPeerImpl peer, int peer_list_index, int reason, String url_parameters) -
updateBiasedPeers
-
addLink
- Specified by:
addLinkin interfaceTRTrackerServerTorrent
-
removeLink
- Specified by:
removeLinkin interfaceTRTrackerServerTorrent
-
exportAnnounceToMap
public Map exportAnnounceToMap(String ip_address, HashMap preprocess_map, TRTrackerServerPeerImpl requesting_peer, boolean include_seeds, int num_want, long interval, long min_interval, boolean no_peer_id, byte compact_mode, byte crypto_level, DHTNetworkPosition network_position) -
exportPeer
private void exportPeer(LinkedList rep_peers, TRTrackerServerSimplePeer peer, boolean send_peer_ids, byte compact_mode, byte crypto_level, DHTNetworkPosition network_position) -
exportScrapeToMap
public Map exportScrapeToMap(String url_parameters, String ip_address, boolean allow_cache) throws TRTrackerServerException - Throws:
TRTrackerServerException
-
checkTimeouts
protected void checkTimeouts() -
checkForPeerListCompaction
protected void checkForPeerListCompaction(boolean force) -
updateXferStats
protected void updateXferStats(int bytes_in, int bytes_out) -
getStats
- Specified by:
getStatsin interfaceTRTrackerServerTorrent
-
getPeerCount
protected int getPeerCount() -
getSeedCount
protected int getSeedCount() -
getSeedCountForScrape
protected int getSeedCountForScrape(boolean requester_is_biased) -
getLeecherCount
protected int getLeecherCount() -
getPeers
- Specified by:
getPeersin interfaceTRTrackerServerTorrent
-
getQueuedCount
protected int getQueuedCount() -
getQueuedPeers
- Specified by:
getQueuedPeersin interfaceTRTrackerServerTorrent
-
getHash
- Specified by:
getHashin interfaceTRTrackerServerTorrent
-
addExplicitBiasedPeer
- Specified by:
addExplicitBiasedPeerin interfaceTRTrackerServerTorrent
-
setRedirects
- Specified by:
setRedirectsin interfaceTRTrackerServerTorrent
-
getRedirects
- Specified by:
getRedirectsin interfaceTRTrackerServerTorrent
-
handleRedirects
protected void handleRedirects(String url_parameters, String real_ip_address, boolean scrape) throws TRTrackerServerException - Throws:
TRTrackerServerException
-
addListener
- Specified by:
addListenerin interfaceTRTrackerServerTorrent
-
removeListener
- Specified by:
removeListenerin interfaceTRTrackerServerTorrent
-
peerEvent
protected void peerEvent(TRTrackerServerPeer peer, int event, String url_parameters) throws TRTrackerServerException - Throws:
TRTrackerServerException
-
addPeerListener
- Specified by:
addPeerListenerin interfaceTRTrackerServerTorrent
-
removePeerListener
- Specified by:
removePeerListenerin interfaceTRTrackerServerTorrent
-
disableCaching
public void disableCaching()- Specified by:
disableCachingin interfaceTRTrackerServerTorrent
-
isCachingEnabled
public boolean isCachingEnabled() -
getBadNATPeerCount
public int getBadNATPeerCount() -
delete
protected void delete() -
getString
- Specified by:
getStringin interfaceTRTrackerServerTorrent
-