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 class
protected static class
protected static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LinkedHashMap
private int
private List
private boolean
static final byte
static final byte
static final byte
static final byte
static final byte
private boolean
private byte[]
private byte
private boolean
private List
private int
private final HashWrapper
private int
private boolean
private Map
private long
private final Map
private final List
private static final LogIDs
private boolean
static final int
static final int
static final int
private int
static final int
private List<TRTrackerServerPeerImpl>
private boolean
private int
private List
private Map<HashWrapper,
TRTrackerServerPeerImpl> private Map<String,
TRTrackerServerPeerImpl> private LinkedList
private static final int
private static final int
private static final int
private final Random
private URL[]
private int
private int
private final TRTrackerServerImpl
private final TRTrackerServerTorrentStatsImpl
protected final AEMonitor
static final boolean
-
Constructor Summary
ConstructorsConstructorDescriptionTRTrackerServerTorrentImpl
(TRTrackerServerImpl _server, HashWrapper _hash, boolean _enabled) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExplicitBiasedPeer
(String ip, int port) void
void
protected void
checkForPeerListCompaction
(boolean force) protected void
protected void
delete()
void
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) private void
exportPeer
(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) int
getHash()
protected int
protected int
getPeers()
protected int
URL[]
protected int
protected int
getSeedCountForScrape
(boolean requester_is_biased) getStats()
protected void
handleRedirects
(String url_parameters, String real_ip_address, boolean scrape) void
importPeers
(List peers) boolean
boolean
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) protected void
peerEvent
(TRTrackerServerPeer peer, int event, String url_parameters) void
peerQueued
(String ip, int tcp_port, int udp_port, int http_port, byte crypto_level, byte az_ver, long timeout_secs, boolean seed) void
void
removeLink
(String link) void
protected void
removePeer
(TRTrackerServerPeerImpl peer, int peer_list_index, int reason, String url_parameters) protected void
removePeer
(TRTrackerServerPeerImpl peer, int reason, String url_parameters) void
void
setEnabled
(boolean _enabled) void
setMinBiasedPeers
(int num) void
setRedirects
(URL[] urls) protected void
updateBiasedPeers
(Set biased_peers_set) protected void
updateXferStats
(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:
setEnabled
in interfaceTRTrackerServerTorrent
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceTRTrackerServerTorrent
-
setMinBiasedPeers
public void setMinBiasedPeers(int num) - Specified by:
setMinBiasedPeers
in interfaceTRTrackerServerTorrent
-
importPeers
- Specified by:
importPeers
in 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:
remove
in interfaceTRTrackerServerTorrent
-
removePeer
-
removePeer
protected void removePeer(TRTrackerServerPeerImpl peer, int peer_list_index, int reason, String url_parameters) -
updateBiasedPeers
-
addLink
- Specified by:
addLink
in interfaceTRTrackerServerTorrent
-
removeLink
- Specified by:
removeLink
in 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:
getStats
in interfaceTRTrackerServerTorrent
-
getPeerCount
protected int getPeerCount() -
getSeedCount
protected int getSeedCount() -
getSeedCountForScrape
protected int getSeedCountForScrape(boolean requester_is_biased) -
getLeecherCount
protected int getLeecherCount() -
getPeers
- Specified by:
getPeers
in interfaceTRTrackerServerTorrent
-
getQueuedCount
protected int getQueuedCount() -
getQueuedPeers
- Specified by:
getQueuedPeers
in interfaceTRTrackerServerTorrent
-
getHash
- Specified by:
getHash
in interfaceTRTrackerServerTorrent
-
addExplicitBiasedPeer
- Specified by:
addExplicitBiasedPeer
in interfaceTRTrackerServerTorrent
-
setRedirects
- Specified by:
setRedirects
in interfaceTRTrackerServerTorrent
-
getRedirects
- Specified by:
getRedirects
in interfaceTRTrackerServerTorrent
-
handleRedirects
protected void handleRedirects(String url_parameters, String real_ip_address, boolean scrape) throws TRTrackerServerException - Throws:
TRTrackerServerException
-
addListener
- Specified by:
addListener
in interfaceTRTrackerServerTorrent
-
removeListener
- Specified by:
removeListener
in interfaceTRTrackerServerTorrent
-
peerEvent
protected void peerEvent(TRTrackerServerPeer peer, int event, String url_parameters) throws TRTrackerServerException - Throws:
TRTrackerServerException
-
addPeerListener
- Specified by:
addPeerListener
in interfaceTRTrackerServerTorrent
-
removePeerListener
- Specified by:
removePeerListener
in interfaceTRTrackerServerTorrent
-
disableCaching
public void disableCaching()- Specified by:
disableCaching
in interfaceTRTrackerServerTorrent
-
isCachingEnabled
public boolean isCachingEnabled() -
getBadNATPeerCount
public int getBadNATPeerCount() -
delete
protected void delete() -
getString
- Specified by:
getString
in interfaceTRTrackerServerTorrent
-