Class PeerUtils
java.lang.Object
com.biglybt.core.peer.util.PeerUtils
Varies peer connection utility methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]private static final Objectprivate static final Objectstatic final String(package private) static final Stringprivate static final Stringprivate static final Stringprivate static final Objectprivate static LocationProviderprivate static longstatic intstatic intprivate static byte[]private static longprivate static byte[]private static longprivate static intprivate static final Objectprivate static final NetworkAdminprivate static final Objectprivate static final Objectprivate static final Object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]static byte[]static String[]getASandASN(PEPeer peer) static Stringstatic String[]getCountryDetails(PEPeer peer) static String[]getCountryDetails(Peer peer) static String[]getCountryDetails(InetAddress address) private static LocationProviderstatic InetAddressgetLocalAddress(PEPeer peer) static NetworkInterfacestatic StringgetNetwork(PEPeer peer) static intgetPeerPriority(byte[] peer_address, int peer_port) private static intgetPeerPriority(byte[] a1, int port1, byte[] a2, int port2) static intgetPeerPriority(byte[] peer_address, short peer_port) static intgetPeerPriority(String address, int port) static intgetPeerPriority(InetAddress address, int peer_port) static booleanstatic booleanignorePeerPort(int port) static voidstatic intnumNewConnectionsAllowed(PeerIdentityDataID data_id, int specific_max) Get the number of new peer connections allowed for the given data item, within the configured per-torrent and global connection limits.private static void
-
Field Details
-
CC_UNKNOWN
- See Also:
-
CONFIG_MAX_CONN_PER_TORRENT
- See Also:
-
CONFIG_MAX_CONN_TOTAL
- See Also:
-
MAX_CONNECTIONS_PER_TORRENT
public static int MAX_CONNECTIONS_PER_TORRENT -
MAX_CONNECTIONS_TOTAL
public static int MAX_CONNECTIONS_TOTAL -
network_admin
-
na_last_ip4_time
private static volatile long na_last_ip4_time -
na_last_ip6_time
private static volatile long na_last_ip6_time -
na_last_ip4
private static volatile byte[] na_last_ip4 -
na_last_ip6
private static volatile byte[] na_last_ip6 -
na_tcp_port
private static int na_tcp_port -
ignore_peer_ports
-
chars
- See Also:
-
country_provider
-
country_provider_last_check
private static long country_provider_last_check -
country_key
-
net_key
-
ni_key
-
ni_null
-
ni_address_key
-
asn_key
-
asn_pending
-
asn_failed
-
-
Constructor Details
-
PeerUtils
public PeerUtils()
-
-
Method Details
-
initialise
public static void initialise() -
getPeerPriority
-
getPeerPriority
-
getPeerPriority
public static int getPeerPriority(byte[] peer_address, short peer_port) -
getPeerPriority
public static int getPeerPriority(byte[] peer_address, int peer_port) -
getPeerPriority
private static int getPeerPriority(byte[] a1, int port1, byte[] a2, int port2) -
numNewConnectionsAllowed
Get the number of new peer connections allowed for the given data item, within the configured per-torrent and global connection limits.- Returns:
- max number of new connections allowed, or -1 if there is no limit
-
readIgnorePeerPorts
private static void readIgnorePeerPorts() -
ignorePeerPort
public static boolean ignorePeerPort(int port) -
createPeerID
public static byte[] createPeerID() -
createWebSeedPeerID
public static byte[] createWebSeedPeerID() -
getCountryProvider
-
hasCountryProvider
public static boolean hasCountryProvider() -
getCountryDetails
-
getCountryDetails
-
getCountryDetails
-
getNetwork
-
getLocalNetworkInterface
-
getLocalAddress
-
getASN
-
getASandASN
-