org.gudy.azureus2.core3.peer.util
Class PeerUtils

java.lang.Object
  extended by org.gudy.azureus2.core3.peer.util.PeerUtils

public class PeerUtils
extends java.lang.Object

Varies peer connection utility methods.


Field Summary
static int MAX_CONNECTIONS_PER_TORRENT
           
static int MAX_CONNECTIONS_TOTAL
           
 
Constructor Summary
PeerUtils()
           
 
Method Summary
static byte[] createPeerID()
           
static byte[] createWebSeedPeerID()
           
static java.lang.String[] getCountryDetails(java.net.InetAddress address)
           
static java.lang.String[] getCountryDetails(Peer peer)
           
static java.lang.String[] getCountryDetails(PEPeer peer)
           
static java.lang.String getNetwork(PEPeer peer)
           
static int getPeerPriority(byte[] peer_address, int peer_port)
           
static int getPeerPriority(byte[] peer_address, short peer_port)
           
static int getPeerPriority(java.net.InetAddress address, int peer_port)
           
static int getPeerPriority(java.lang.String address, int port)
           
static boolean ignorePeerPort(int port)
           
static int numNewConnectionsAllowed(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_CONNECTIONS_PER_TORRENT

public static int MAX_CONNECTIONS_PER_TORRENT

MAX_CONNECTIONS_TOTAL

public static int MAX_CONNECTIONS_TOTAL
Constructor Detail

PeerUtils

public PeerUtils()
Method Detail

getPeerPriority

public static int getPeerPriority(java.lang.String address,
                                  int port)

getPeerPriority

public static int getPeerPriority(java.net.InetAddress address,
                                  int peer_port)

getPeerPriority

public static int getPeerPriority(byte[] peer_address,
                                  short peer_port)

getPeerPriority

public static int getPeerPriority(byte[] peer_address,
                                  int peer_port)

numNewConnectionsAllowed

public static int numNewConnectionsAllowed(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.

Returns:
max number of new connections allowed, or -1 if there is no limit

ignorePeerPort

public static boolean ignorePeerPort(int port)

createPeerID

public static byte[] createPeerID()

createWebSeedPeerID

public static byte[] createWebSeedPeerID()

getCountryDetails

public static java.lang.String[] getCountryDetails(Peer peer)

getCountryDetails

public static java.lang.String[] getCountryDetails(PEPeer peer)

getCountryDetails

public static java.lang.String[] getCountryDetails(java.net.InetAddress address)

getNetwork

public static java.lang.String getNetwork(PEPeer peer)