Class PeerItem
java.lang.Object
com.biglybt.core.peermanager.peerdb.PeerItem
- All Implemented Interfaces:
DataSourceResolver.ExportableDataSource, PeerDescriptor
Represents a peer item, unique by ip address + port combo.
NOTE: Overrides equals().
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]private final byteprivate final byteprivate final intprivate final Stringprivate final intprivate final byteprivate final shortprivate final shortprivate final shortFields inherited from interface DataSourceResolver.ExportableDataSource
OPT_CAN_MINIMIZE, OPT_ON_TOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintstatic byteconvertSourceID(String source) static StringconvertSourceString(byte source_id) booleanbytebytegetIP()source as defined in DownloadAnnounceResultPeerlongbyte[]byteintintinthashCode()booleanisIPv4()booleanMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DataSourceResolver.ExportableDataSource
getBooleanOption
-
Field Details
-
address
private final byte[] address -
udp_port
private final short udp_port -
tcp_port
private final short tcp_port -
source
private final byte source -
hashcode
private final int hashcode -
handshake
private final byte handshake -
crypto_level
private final byte crypto_level -
up_speed
private final short up_speed -
priority
private final int priority -
network
-
-
Constructor Details
-
PeerItem
protected PeerItem(String _address, int _tcp_port, byte _source, byte _handshake, int _udp_port, byte _crypto_level, int _up_speed) -
PeerItem
-
-
Method Details
-
getSerialization
public byte[] getSerialization() -
getAddressString
-
getIP
- Specified by:
getIPin interfacePeerDescriptor
-
getNetwork
-
getTCPPort
public int getTCPPort()- Specified by:
getTCPPortin interfacePeerDescriptor
-
getUDPPort
public int getUDPPort()- Specified by:
getUDPPortin interfacePeerDescriptor
-
getSource
public byte getSource() -
getPeerSource
Description copied from interface:PeerDescriptorsource as defined in DownloadAnnounceResultPeer- Specified by:
getPeerSourcein interfacePeerDescriptor- Returns:
-
getHandshakeType
public byte getHandshakeType() -
getCryptoLevel
public byte getCryptoLevel() -
useCrypto
public boolean useCrypto()- Specified by:
useCryptoin interfacePeerDescriptor
-
equals
-
hashCode
-
compareTo
-
getPriority
public long getPriority() -
convertSourceString
-
convertSourceID
-
isIPv4
public boolean isIPv4() -
exportDataSource
- Specified by:
exportDataSourcein interfaceDataSourceResolver.ExportableDataSource
-