Class PeerForeignDelegate
java.lang.Object
com.biglybt.pifimpl.local.peers.PeerForeignDelegate
- All Implemented Interfaces:
PEPeerTransport, PEPeer, Taggable, Taggable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprivate BitFlagsprivate booleanprivate intprivate longprivate Mapprivate final Peerprivate booleanprivate longprivate longprivate final PeerManagerImplprivate final NetworkConnectionBaseprivate HashMap<PEPeerListener, PeerListener2> private booleanprivate int[]private AtomicLongprotected AEMonitorFields inherited from interface PEPeer
CLOSING, CONNECTING, DISCONNECTED, HANDSHAKING, MESSAGING_AZMP, MESSAGING_BT_ONLY, MESSAGING_EXTERN, MESSAGING_LTEP, StateNames, TRANSFERINGFields inherited from interface PEPeerTransport
CONNECTION_CONNECTING, CONNECTION_FULLY_ESTABLISHED, CONNECTION_PENDING, CONNECTION_WAITING_FOR_HANDSHAKE, CP_CONNECT_FAILED, CP_CONNECT_OK, CP_CONNECTING, CP_RECEIVED_DATA, CP_UNKNOWNFields inherited from interface Taggable
TT_DOWNLOAD, TT_NONE, TT_PEER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPeerForeignDelegate(PeerManagerImpl _manager, Peer _foreign) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd peer listener.voidaddRateLimiter(LimitedRateGroup limiter, boolean upload) voidaddReservedPieceNumber(int piece_number) adds the reserved piece for piece picking by this peerbooleanvoidNothing to do if calledvoidNothing to do if calledvoidvoidcloseConnection(String reason, int reason_code) Close the peer connectionprotected voidvoidCheck if we need to send a keep-alive message.voidPerform checks related to performance optimizations, i.e.booleanCheck for possible connection timeouts.booleanvoidgenerateEvidence(IndentWriter writer) longlongGet the time this connection was first established.intGet the specific peer connection state.intint[]int[]To retreive arbitrary objects against a peer.intReturns name of encryption used by the peerbyte[]byte[]getId()intintint[]get a list of piece numbers the peer has requestedgetIp()Gets the host name for the IP, if possible, IP as string otherwiselongintlongintpeer-specific request max.intintintintint[]get a list of piece numbers the we have requested from peerGet the peer's address + port identification item.intintGet the peer's torrent completion percentage in thousand-notation, i.e.Get the connection that backs this peer.intgetPort()Get the peer's local TCP connection port.int[]Any priority offsets this peer has, or null if nonegetRateLimiters(boolean upload) int[]Get current request hint for a given piece for this peer.intgetRequestIndex(DiskManagerReadRequest request) Returns the index of this request in the peer's queue or -1 if not foundint[]Get the reserved pieces for piece picking by this peerlonggetStats()Message[]Get the list of messages that this peer and us both understand.intlongintGet the TCP port this peer is listening for incoming connections on.longGet the time since the most-recent data that was actually written to disk was received.longGet the time since the last (most-recent) data (payload) message was received.longGet the time since the last (most-recent) data (payload) message was sent.intGet the UDP port this peer is listening for incoming connections on.intGet the UDP port this peer is listening on for non-data connectionslongintintintgetUserData(Object key) To retreive arbitrary objects against a peer.inthashCode()booleanbooleanApaprently nothing significant to do if calledbooleanAm I choking the peer.booleanIs the peer choking me.booleanisClosed()booleanbooleanchecks several factors within the object so the caller wouldn't need to for convenience and speed.booleanbooleanIs the peer Interested in me.booleanAm I Interested in the peer.booleanIs the connection within the local LAN network.booleanisMyPeer()Whether or not this is a 'dummy' peer that represents our presence in a swarmbooleanbooleanisPieceAvailable(int pieceNumber) booleanbooleanbooleanbooleanThis method is called to check if it is safe to reconnect to a peer, i.e.booleanisSeed()booleanbooleanis peer waiting for a disk read with no network writes queuedbooleanisTCP()booleanbooleanAttempts to reconnect to the same peervoidRemove peer listener.voidremoveRateLimiter(LimitedRateGroup limiter, boolean upload) voidremoveReservedPieceNumber(int piece_number) request(int pieceNumber, int pieceOffset, int pieceLength, boolean return_duplicates) voidbooleanrequestAllocationStarts(int[] base_priorities) Two methods that allow a peer to aggregate the individual requests generated during an allocation cycle if so desiredvoidvoidsendBadPiece(int piece_number) voidsendCancel(DiskManagerReadRequest request) voidShould never be calledvoidvoidsendHave(int piece) Nothing to do if calledvoidsendHolePunch(InetAddress address, int port) voidsendRejectRequest(DiskManagerReadRequest request) booleansendRequestHint(int piece_number, int offset, int length, int life) Send a request hint to the peer.voidsendStatsReply(Map reply) voidsendStatsRequest(Map request) voidShould never be calledvoidsetConsecutiveNoRequestCount(int num) voidTo store arbitrary objects against a peer.voidsetDownloadDisabled(Object key, boolean disabled) voidsetDownloadRateLimitBytesPerSecond(int bytes) voidsetHaveAggregationEnabled(boolean enabled) voidsetLastPiece(int pieceNumber) voidsetOptimisticUnchoke(boolean is_optimistic) voidsetPriorityConnection(boolean is_priority) voidsetSnubbed(boolean b) voidsetSuspendedLazyBitFieldEnabled(boolean enable) Enable suspended lazy bitfield for this peer - we will appear incomplete until this is disabled, at which point (well, fairly soon after) the bitfield will be completedvoidsetTaggableTransientProperty(String key, Object value) voidsetUniqueAnnounce(int uniquePieceNumber) voidsetUploadDisabled(Object key, boolean disabled) voidsetUploadHint(int timeToSpread) voidsetUploadRateLimitBytesPerSecond(int bytes) voidsetUserData(Object key, Object value) To store arbitrary objects against a peer.voidstart()Start message processing for the peerprotected voidstop()booleanWhether or not this peer supports the advanced messaging API.booleanvoidupdateAutoUploadPriority(Object key, boolean inc) voidDo any peer exchange processing/updating.voidMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PEPeer
getPercentDoneOfCurrentIncomingRequest, getPercentDoneOfCurrentOutgoingRequest, getRecentPiecesSent
-
Field Details
-
_lastPiece
protected volatile int _lastPiece -
manager
-
foreign
-
network_connection
-
create_time_mono
private long create_time_mono -
last_data_received_time
private long last_data_received_time -
last_data_message_received_time
private long last_data_message_received_time -
reserved_pieces
private int[] reserved_pieces -
consecutive_no_requests
private int consecutive_no_requests -
bit_flags
-
priority_connection
private boolean priority_connection -
data
-
peer_listeners
-
this_mon
-
download_disabled_set
-
is_download_disabled
private boolean is_download_disabled -
tagMutationCounter
-
closed
private volatile boolean closed
-
-
Constructor Details
-
PeerForeignDelegate
-
-
Method Details
-
isMyPeer
-
getOutboundConnectionProgress
public int getOutboundConnectionProgress()- Specified by:
getOutboundConnectionProgressin interfacePEPeerTransport
-
start
public void start()Description copied from interface:PEPeerTransportStart message processing for the peer- Specified by:
startin interfacePEPeerTransport
-
stop
protected void stop() -
sendChoke
public void sendChoke()Should never be called- Specified by:
sendChokein interfacePEPeer- Specified by:
sendChokein interfacePEPeerTransport
-
sendHave
public void sendHave(int piece) Nothing to do if called- Specified by:
sendHavein interfacePEPeerTransport
-
sendUnChoke
public void sendUnChoke()Should never be called- Specified by:
sendUnChokein interfacePEPeer- Specified by:
sendUnChokein interfacePEPeerTransport
-
getAlternativeIPv6
- Specified by:
getAlternativeIPv6in interfacePEPeer- Returns:
- an ipv6 address under which the peer should be connectable if it announced one, null otherwise
-
transferAvailable
public boolean transferAvailable()- Specified by:
transferAvailablein interfacePEPeer- Specified by:
transferAvailablein interfacePEPeerTransport
-
isDownloadPossible
public boolean isDownloadPossible()Description copied from interface:PEPeerchecks several factors within the object so the caller wouldn't need to for convenience and speed.- Specified by:
isDownloadPossiblein interfacePEPeer- Returns:
- true if none of several criteria indicate a request can't be made of the peer
-
sendCancel
- Specified by:
sendCancelin interfacePEPeerTransport
-
request
public DiskManagerReadRequest request(int pieceNumber, int pieceOffset, int pieceLength, boolean return_duplicates) - Specified by:
requestin interfacePEPeerTransport- Parameters:
pieceNumber-pieceOffset-pieceLength-return_duplicates- - if true and request already exists it will be returned, if false -> null- Returns:
- true is the piece is really requested
-
getRequestIndex
Description copied from interface:PEPeerTransportReturns the index of this request in the peer's queue or -1 if not found- Specified by:
getRequestIndexin interfacePEPeerTransport- Returns:
-
dataReceived
protected void dataReceived() -
closeConnection
Description copied from interface:PEPeerTransportClose the peer connection- Specified by:
closeConnectionin interfacePEPeerTransport- Parameters:
reason- for closure
-
isClosed
-
getExpiredRequests
- Specified by:
getExpiredRequestsin interfacePEPeerTransport
-
getLastMessageSentTimeMono
public long getLastMessageSentTimeMono()- Specified by:
getLastMessageSentTimeMonoin interfacePEPeerTransport
-
getMaxNbRequests
public int getMaxNbRequests()Description copied from interface:PEPeerTransportpeer-specific request max. return -1 to use the default piece-picker allocation method- Specified by:
getMaxNbRequestsin interfacePEPeerTransport- Returns:
-
getNbRequests
public int getNbRequests()- Specified by:
getNbRequestsin interfacePEPeerTransport
-
getPriorityOffsets
public int[] getPriorityOffsets()Description copied from interface:PEPeerTransportAny priority offsets this peer has, or null if none- Specified by:
getPriorityOffsetsin interfacePEPeerTransport- Returns:
-
requestAllocationStarts
public boolean requestAllocationStarts(int[] base_priorities) Description copied from interface:PEPeerTransportTwo methods that allow a peer to aggregate the individual requests generated during an allocation cycle if so desired- Specified by:
requestAllocationStartsin interfacePEPeerTransport- Returns:
- true if the peer is managing request priorities and doesn't want end-game random allocation behaviour
-
requestAllocationComplete
public void requestAllocationComplete()- Specified by:
requestAllocationCompletein interfacePEPeerTransport
-
getControl
- Specified by:
getControlin interfacePEPeerTransport
-
updatePeerExchange
public void updatePeerExchange()Description copied from interface:PEPeerTransportDo any peer exchange processing/updating.- Specified by:
updatePeerExchangein interfacePEPeerTransport
-
getPeerItemIdentity
Description copied from interface:PEPeerTransportGet the peer's address + port identification item.- Specified by:
getPeerItemIdentityin interfacePEPeerTransport- Returns:
- id
-
getConnectionState
public int getConnectionState()Description copied from interface:PEPeerTransportGet the specific peer connection state.- Specified by:
getConnectionStatein interfacePEPeerTransport- Returns:
- connection state
-
doKeepAliveCheck
public void doKeepAliveCheck()Description copied from interface:PEPeerTransportCheck if we need to send a keep-alive message. A keep-alive is sent if no other message has been sent within the last 2min.- Specified by:
doKeepAliveCheckin interfacePEPeerTransport
-
doTimeoutChecks
public boolean doTimeoutChecks()Description copied from interface:PEPeerTransportCheck for possible connection timeouts.- Specified by:
doTimeoutChecksin interfacePEPeerTransport- Returns:
- true if the connection has been timed-out, false if not
-
doPerformanceTuningCheck
public void doPerformanceTuningCheck()Description copied from interface:PEPeerTransportPerform checks related to performance optimizations, i.e. tune buffering related to send/receive speed.- Specified by:
doPerformanceTuningCheckin interfacePEPeerTransport
-
setSuspendedLazyBitFieldEnabled
public void setSuspendedLazyBitFieldEnabled(boolean enable) Description copied from interface:PEPeerEnable suspended lazy bitfield for this peer - we will appear incomplete until this is disabled, at which point (well, fairly soon after) the bitfield will be completed- Specified by:
setSuspendedLazyBitFieldEnabledin interfacePEPeer- Parameters:
enable-
-
getConnectionEstablishedMonoTime
public long getConnectionEstablishedMonoTime()Description copied from interface:PEPeerGet the time this connection was first established. NOTE: This method will always return -1 at any time before the underlying transport is fully connected, i.e. before handshaking begins.- Specified by:
getConnectionEstablishedMonoTimein interfacePEPeer- Returns:
- mono time in ms
-
getTimeSinceLastDataMessageReceived
public long getTimeSinceLastDataMessageReceived()Description copied from interface:PEPeerTransportGet the time since the last (most-recent) data (payload) message was received.- Specified by:
getTimeSinceLastDataMessageReceivedin interfacePEPeerTransport- Returns:
- time count in ms, or -1 if we've never received a data message from them
-
getTimeSinceGoodDataReceived
public long getTimeSinceGoodDataReceived()Description copied from interface:PEPeerTransportGet the time since the most-recent data that was actually written to disk was received.- Specified by:
getTimeSinceGoodDataReceivedin interfacePEPeerTransport- Returns:
- time count in ms, or -1 if we've never received useful data from them
-
getTimeSinceLastDataMessageSent
public long getTimeSinceLastDataMessageSent()Description copied from interface:PEPeerTransportGet the time since the last (most-recent) data (payload) message was sent.- Specified by:
getTimeSinceLastDataMessageSentin interfacePEPeerTransport- Returns:
- time count in ms, or -1 if we've never sent them a data message
-
getUnchokedForMillis
public long getUnchokedForMillis()- Specified by:
getUnchokedForMillisin interfacePEPeerTransport
-
getLatency
public long getLatency()- Specified by:
getLatencyin interfacePEPeerTransport
-
getConsecutiveNoRequestCount
public int getConsecutiveNoRequestCount()- Specified by:
getConsecutiveNoRequestCountin interfacePEPeer
-
setConsecutiveNoRequestCount
public void setConsecutiveNoRequestCount(int num) - Specified by:
setConsecutiveNoRequestCountin interfacePEPeer
-
getManager
- Specified by:
getManagerin interfacePEPeer
-
getPeerSource
- Specified by:
getPeerSourcein interfacePEPeer
-
getPeerState
public int getPeerState()- Specified by:
getPeerStatein interfacePEPeer
-
getId
-
getIp
-
getIPHostName
Description copied from interface:PEPeerGets the host name for the IP, if possible, IP as string otherwise- Specified by:
getIPHostNamein interfacePEPeer- Returns:
- hostname or IP
-
getPort
-
getTCPListenPort
public int getTCPListenPort()Description copied from interface:PEPeerGet the TCP port this peer is listening for incoming connections on.- Specified by:
getTCPListenPortin interfacePEPeer- Returns:
- TCP port, or 0 if port is unknown
-
getUDPListenPort
public int getUDPListenPort()Description copied from interface:PEPeerGet the UDP port this peer is listening for incoming connections on.- Specified by:
getUDPListenPortin interfacePEPeer- Returns:
- UDP port, or 0 if port is unknown
-
getUDPNonDataListenPort
public int getUDPNonDataListenPort()Description copied from interface:PEPeerGet the UDP port this peer is listening on for non-data connections- Specified by:
getUDPNonDataListenPortin interfacePEPeer- Returns:
-
getAvailable
- Specified by:
getAvailablein interfacePEPeer
-
hasReceivedBitField
public boolean hasReceivedBitField()- Specified by:
hasReceivedBitFieldin interfacePEPeer
-
isPieceAvailable
public boolean isPieceAvailable(int pieceNumber) - Specified by:
isPieceAvailablein interfacePEPeer- Parameters:
pieceNumber- int- Returns:
- true if this peers makes this piece available
-
setSnubbed
public void setSnubbed(boolean b) - Specified by:
setSnubbedin interfacePEPeer
-
isChokingMe
public boolean isChokingMe()Description copied from interface:PEPeerIs the peer choking me.- Specified by:
isChokingMein interfacePEPeer- Returns:
- true if I am choked by the peer, false if not
-
isChokedByMe
public boolean isChokedByMe()Description copied from interface:PEPeerAm I choking the peer.- Specified by:
isChokedByMein interfacePEPeer- Returns:
- true if the peer is choked, false if not
-
isUnchokeOverride
public boolean isUnchokeOverride()- Specified by:
isUnchokeOverridein interfacePEPeer
-
isInteresting
public boolean isInteresting()Description copied from interface:PEPeerAm I Interested in the peer.- Specified by:
isInterestingin interfacePEPeer- Returns:
- true if peer is interesting, false if not
-
isInterested
public boolean isInterested()Description copied from interface:PEPeerIs the peer Interested in me.- Specified by:
isInterestedin interfacePEPeer- Returns:
- true if the peer is interested in me, false if not
-
isSeed
-
isRelativeSeed
public boolean isRelativeSeed()- Specified by:
isRelativeSeedin interfacePEPeer- Returns:
- true if the peer is only uploading and can't use the data we have to offer (we're seeding) or we can't use the data he has to offer (we're downloading)
-
isSnubbed
-
getSnubbedTime
public long getSnubbedTime()- Specified by:
getSnubbedTimein interfacePEPeer
-
isLANLocal
public boolean isLANLocal()Description copied from interface:PEPeerTransportIs the connection within the local LAN network.- Specified by:
isLANLocalin interfacePEPeer- Specified by:
isLANLocalin interfacePEPeerTransport- Returns:
- true if within LAN, false of outside the LAN segment
-
resetLANLocalStatus
public void resetLANLocalStatus()- Specified by:
resetLANLocalStatusin interfacePEPeer
-
sendRequestHint
public boolean sendRequestHint(int piece_number, int offset, int length, int life) Description copied from interface:PEPeerSend a request hint to the peer.- Specified by:
sendRequestHintin interfacePEPeer- Parameters:
piece_number-offset-length-life-- Returns:
- true if sent, false otherwise
-
getRequestHint
public int[] getRequestHint()Description copied from interface:PEPeerGet current request hint for a given piece for this peer.- Specified by:
getRequestHintin interfacePEPeer- Returns:
- null if no hint int[]{ piece_number, offset, length } if hint found
-
clearRequestHint
public void clearRequestHint()- Specified by:
clearRequestHintin interfacePEPeer
-
sendRejectRequest
- Specified by:
sendRejectRequestin interfacePEPeer
-
sendBadPiece
public void sendBadPiece(int piece_number) - Specified by:
sendBadPiecein interfacePEPeerTransport
-
sendStatsRequest
- Specified by:
sendStatsRequestin interfacePEPeer- Specified by:
sendStatsRequestin interfacePEPeerTransport
-
sendStatsReply
- Specified by:
sendStatsReplyin interfacePEPeerTransport
-
sendHashRequest
- Specified by:
sendHashRequestin interfacePEPeerTransport
-
isTCP
public boolean isTCP()- Specified by:
isTCPin interfacePEPeerTransport
-
getNetwork
- Specified by:
getNetworkin interfacePEPeerTransport
-
getStats
-
isIncoming
public boolean isIncoming()- Specified by:
isIncomingin interfacePEPeer
-
getPercentDoneInThousandNotation
public int getPercentDoneInThousandNotation()Description copied from interface:PEPeerGet the peer's torrent completion percentage in thousand-notation, i.e. 53.7% is returned as the value 0537.- Specified by:
getPercentDoneInThousandNotationin interfacePEPeer- Returns:
- the percentage the peer has complete
-
getBytesRemaining
public long getBytesRemaining()- Specified by:
getBytesRemainingin interfacePEPeer
-
getClient
-
getHandshakeReservedBytes
public byte[] getHandshakeReservedBytes()- Specified by:
getHandshakeReservedBytesin interfacePEPeer
-
isOptimisticUnchoke
public boolean isOptimisticUnchoke()- Specified by:
isOptimisticUnchokein interfacePEPeer
-
setOptimisticUnchoke
public void setOptimisticUnchoke(boolean is_optimistic) - Specified by:
setOptimisticUnchokein interfacePEPeer
-
getUniqueAnnounce
public int getUniqueAnnounce()- Specified by:
getUniqueAnnouncein interfacePEPeer
-
getUploadHint
public int getUploadHint()- Specified by:
getUploadHintin interfacePEPeer
-
setUniqueAnnounce
public void setUniqueAnnounce(int uniquePieceNumber) - Specified by:
setUniqueAnnouncein interfacePEPeer
-
setUploadHint
public void setUploadHint(int timeToSpread) - Specified by:
setUploadHintin interfacePEPeer
-
isStalledPendingLoad
public boolean isStalledPendingLoad()Description copied from interface:PEPeerTransportis peer waiting for a disk read with no network writes queued- Specified by:
isStalledPendingLoadin interfacePEPeerTransport- Returns:
-
addListener
Description copied from interface:PEPeerAdd peer listener.- Specified by:
addListenerin interfacePEPeer- Parameters:
l-
-
removeListener
Description copied from interface:PEPeerRemove peer listener.- Specified by:
removeListenerin interfacePEPeer- Parameters:
l-
-
getNetworkConnection
- Specified by:
getNetworkConnectionin interfacePEPeer
-
getPluginConnection
Description copied from interface:PEPeerGet the connection that backs this peer.- Specified by:
getPluginConnectionin interfacePEPeer- Returns:
- connection
-
getCurrentIncomingRequestProgress
public int[] getCurrentIncomingRequestProgress()- Specified by:
getCurrentIncomingRequestProgressin interfacePEPeer- Returns:
- null or { size, done }
-
getCurrentOutgoingRequestProgress
public int[] getCurrentOutgoingRequestProgress()- Specified by:
getCurrentOutgoingRequestProgressin interfacePEPeer
-
supportsMessaging
public boolean supportsMessaging()Description copied from interface:PEPeerWhether or not this peer supports the advanced messaging API.- Specified by:
supportsMessagingin interfacePEPeer- Returns:
- true if extended messaging is supported, false if not
-
getMessagingMode
public int getMessagingMode()- Specified by:
getMessagingModein interfacePEPeer
-
getEncryption
Description copied from interface:PEPeerReturns name of encryption used by the peer- Specified by:
getEncryptionin interfacePEPeer- Returns:
-
getProtocol
- Specified by:
getProtocolin interfacePEPeer
-
getProtocolQualifier
- Specified by:
getProtocolQualifierin interfacePEPeer
-
getSupportedMessages
Description copied from interface:PEPeerGet the list of messages that this peer and us both understand.- Specified by:
getSupportedMessagesin interfacePEPeer- Returns:
- messages available for use, or null of supported is yet unknown or unavailable
-
getData
-
setData
-
getUserData
To retreive arbitrary objects against a peer.- Specified by:
getUserDatain interfacePEPeer
-
setUserData
To store arbitrary objects against a peer.- Specified by:
setUserDatain interfacePEPeer
-
equals
-
hashCode
-
getReservedPieceNumbers
public int[] getReservedPieceNumbers()Description copied from interface:PEPeerGet the reserved pieces for piece picking by this peer- Specified by:
getReservedPieceNumbersin interfacePEPeer
-
addReservedPieceNumber
public void addReservedPieceNumber(int piece_number) Description copied from interface:PEPeeradds the reserved piece for piece picking by this peer- Specified by:
addReservedPieceNumberin interfacePEPeer
-
removeReservedPieceNumber
public void removeReservedPieceNumber(int piece_number) - Specified by:
removeReservedPieceNumberin interfacePEPeer
-
getIncomingRequestedPieceNumbers
public int[] getIncomingRequestedPieceNumbers()Description copied from interface:PEPeerget a list of piece numbers the peer has requested- Specified by:
getIncomingRequestedPieceNumbersin interfacePEPeer- Returns:
- list of Long() representing the piece number requested, in order
-
getIncomingRequestedPieceNumberCount
public int getIncomingRequestedPieceNumberCount()- Specified by:
getIncomingRequestedPieceNumberCountin interfacePEPeerTransport
-
getIncomingRequestCount
public int getIncomingRequestCount()- Specified by:
getIncomingRequestCountin interfacePEPeer
-
getOutgoingRequestCount
public int getOutgoingRequestCount()- Specified by:
getOutgoingRequestCountin interfacePEPeer
-
getOutgoingRequestedPieceNumbers
public int[] getOutgoingRequestedPieceNumbers()Description copied from interface:PEPeerget a list of piece numbers the we have requested from peer- Specified by:
getOutgoingRequestedPieceNumbersin interfacePEPeer- Returns:
- list of Long() representing the piece number requested, oldest to newest
-
getLastPiece
public int getLastPiece()- Specified by:
getLastPiecein interfacePEPeer
-
setLastPiece
public void setLastPiece(int pieceNumber) - Specified by:
setLastPiecein interfacePEPeer
-
checkInterested
public void checkInterested()Nothing to do if called- Specified by:
checkInterestedin interfacePEPeerTransport
-
isAvailabilityAdded
public boolean isAvailabilityAdded()Apaprently nothing significant to do if called -
clearAvailabilityAdded
public void clearAvailabilityAdded()Nothing to do if called -
reconnect
Description copied from interface:PEPeerTransportAttempts to reconnect to the same peer- Specified by:
reconnectin interfacePEPeerTransport- Parameters:
tryUDP- try to initiate a UDP connection if true, just reestablish the previous state otherwisetryIPv6- TODO- Returns:
- null if reconnect not possible, reconnected peer otherwise
-
isReconnect
public boolean isReconnect()- Specified by:
isReconnectin interfacePEPeerTransport
-
isSafeForReconnect
public boolean isSafeForReconnect()Description copied from interface:PEPeerTransportThis method is called to check if it is safe to reconnect to a peer, i.e. avoid hammering exchanging data with a peer should work as it takes time to setup the connection and negotiate things before that happens- Specified by:
isSafeForReconnectin interfacePEPeerTransport- Returns:
- true if we exchanged payload data with the peer during the current connection
-
setUploadRateLimitBytesPerSecond
public void setUploadRateLimitBytesPerSecond(int bytes) - Specified by:
setUploadRateLimitBytesPerSecondin interfacePEPeer
-
setDownloadRateLimitBytesPerSecond
public void setDownloadRateLimitBytesPerSecond(int bytes) - Specified by:
setDownloadRateLimitBytesPerSecondin interfacePEPeer
-
getUploadRateLimitBytesPerSecond
public int getUploadRateLimitBytesPerSecond()- Specified by:
getUploadRateLimitBytesPerSecondin interfacePEPeer
-
getDownloadRateLimitBytesPerSecond
public int getDownloadRateLimitBytesPerSecond()- Specified by:
getDownloadRateLimitBytesPerSecondin interfacePEPeer
-
updateAutoUploadPriority
- Specified by:
updateAutoUploadPriorityin interfacePEPeer
-
addRateLimiter
- Specified by:
addRateLimiterin interfacePEPeer
-
getRateLimiters
- Specified by:
getRateLimitersin interfacePEPeer
-
removeRateLimiter
- Specified by:
removeRateLimiterin interfacePEPeer
-
setUploadDisabled
- Specified by:
setUploadDisabledin interfacePEPeer
-
setDownloadDisabled
- Specified by:
setDownloadDisabledin interfacePEPeer
-
isUploadDisabled
public boolean isUploadDisabled()- Specified by:
isUploadDisabledin interfacePEPeer
-
isDownloadDisabled
public boolean isDownloadDisabled()- Specified by:
isDownloadDisabledin interfacePEPeer
-
setHaveAggregationEnabled
public void setHaveAggregationEnabled(boolean enabled) - Specified by:
setHaveAggregationEnabledin interfacePEPeer
-
setPriorityConnection
public void setPriorityConnection(boolean is_priority) - Specified by:
setPriorityConnectionin interfacePEPeer
-
isPriorityConnection
public boolean isPriorityConnection()- Specified by:
isPriorityConnectionin interfacePEPeer
-
canSendHolePunch
public boolean canSendHolePunch()- Specified by:
canSendHolePunchin interfacePEPeerTransport
-
sendHolePunch
- Specified by:
sendHolePunchin interfacePEPeerTransport
-
generateEvidence
- Specified by:
generateEvidencein interfacePEPeerTransport
-
getClientNameFromExtensionHandshake
- Specified by:
getClientNameFromExtensionHandshakein interfacePEPeer
-
getClientNameFromPeerID
- Specified by:
getClientNameFromPeerIDin interfacePEPeer
-
getTaggableType
public int getTaggableType()- Specified by:
getTaggableTypein interfaceTaggable
-
getTaggableID
- Specified by:
getTaggableIDin interfaceTaggable
-
getTaggableName
- Specified by:
getTaggableNamein interfaceTaggable
-
getTaggableResolver
- Specified by:
getTaggableResolverin interfaceTaggable
-
getTagMutationCount
public long getTagMutationCount()- Specified by:
getTagMutationCountin interfaceTaggable
-
updateTagMutationCount
public void updateTagMutationCount()- Specified by:
updateTagMutationCountin interfaceTaggable
-
getTaggableTransientProperty
- Specified by:
getTaggableTransientPropertyin interfaceTaggable
-
setTaggableTransientProperty
- Specified by:
setTaggableTransientPropertyin interfaceTaggable
-
getDescriptor
- Specified by:
getDescriptorin interfacePEPeer
-