FileDocCategorySizeDatePackage
PEPeerTransport.javaAPI DocAzureus 3.0.3.45493Wed Jul 18 14:45:44 BST 2007org.gudy.azureus2.core3.peer.impl

PEPeerTransport

public interface PEPeerTransport implements org.gudy.azureus2.core3.peer.PEPeer

Fields Summary
public static final int
CONNECTION_PENDING
public static final int
CONNECTION_CONNECTING
public static final int
CONNECTION_WAITING_FOR_HANDSHAKE
public static final int
CONNECTION_FULLY_ESTABLISHED
Constructors Summary
Methods Summary
public voidcheckInterested()
if it doesn't go as expected when trying to find a piece to ask a peer for, need to double check if we're still interested in them, and get the BT protocol sycnhed

public voidcloseConnection(java.lang.String reason)
Close the peer connection

param
reason for closure

public voiddoKeepAliveCheck()
Check 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.

public voiddoPerformanceTuningCheck()
Perform checks related to performance optimizations, i.e. tune buffering related to send/receive speed.

public booleandoTimeoutChecks()
Check for possible connection timeouts.

return
true if the connection has been timed-out, false if not

public voidgenerateEvidence(org.gudy.azureus2.core3.util.IndentWriter writer)

public intgetConnectionState()
Get the specific peer connection state.

return
connection state

public PEPeerControlgetControl()

public java.util.ListgetExpiredRequests()

public intgetMaxNbRequests()
peer-specific request max. return -1 to use the default piece-picker allocation method

return

public intgetNbRequests()

public com.aelitis.azureus.core.peermanager.peerdb.PeerItemgetPeerItemIdentity()
Get the peer's address + port identification item.

return
id

public int[]getPriorityOffsets()
Any priority offsets this peer has, or null if none

return

public intgetRequestIndex(org.gudy.azureus2.core3.disk.DiskManagerReadRequest request)
Returns the index of this request in the peer's queue or -1 if not found

return

public longgetTimeSinceGoodDataReceived()
Get the time since the most-recent data that was actually written to disk was received.

return
time count in ms, or -1 if we've never received usefull data from them

public longgetTimeSinceLastDataMessageReceived()
Get the time since the last (most-recent) data (payload) message was received.

return
time count in ms, or -1 if we've never received a data message from them

public longgetTimeSinceLastDataMessageSent()
Get the time since the last (most-recent) data (payload) message was sent.

return
time count in ms, or -1 if we've never sent them a data message

public booleanisLANLocal()
Is the connection within the local LAN network.

return
true if within LAN, false of outside the LAN segment

public booleanisStalledPendingLoad()
is peer waiting for a disk read with no network writes queued

return

public booleanisTCP()

public org.gudy.azureus2.core3.peer.impl.PEPeerTransportreconnect()
Attempts to reconnect to the same peer

return
null if reconnect not possible, reconnected peer otherwise

public org.gudy.azureus2.core3.disk.DiskManagerReadRequestrequest(int pieceNumber, int pieceOffset, int pieceLength)

param
pieceNumber
param
pieceOffset
param
pieceLength
return
request if actually requested, null otherwise

public voidrequestAllocationComplete()

public booleanrequestAllocationStarts(int[] base_priorities)
Two methods that allow a peer to aggregate the individual requests generated during an allocation cycle if so desired

return
true if the peer is managing request priorities and doesn't want end-game random allocation behaviour

public voidsendBadPiece(int piece_number)

public voidsendCancel(org.gudy.azureus2.core3.disk.DiskManagerReadRequest request)

public voidsendChoke()

public voidsendHave(int piece)

public voidsendUnChoke()

public voidstart()
Start message processing for the peer

public booleantransferAvailable()

public voidupdatePeerExchange()
Do any peer exchange processing/updating.