|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Peer
| Field Summary | |
|---|---|
static int |
CLOSING
|
static int |
CONNECTING
|
static int |
DISCONNECTED
|
static int |
HANDSHAKING
|
static int |
TRANSFERING
|
| Method Summary | |
|---|---|
void |
addListener(PeerListener listener)
Deprecated. use addListener( PeerListener2 ) |
void |
addListener(PeerListener2 listener)
Add peer listener. |
boolean |
addRequest(PeerReadRequest request)
|
void |
cancelRequest(PeerReadRequest request)
|
void |
close(java.lang.String reason,
boolean closedOnError,
boolean attemptReconnect)
|
boolean[] |
getAvailable()
|
java.lang.String |
getClient()
|
Connection |
getConnection()
Get the network connection that backs this peer. |
java.util.List |
getExpiredRequests()
|
byte[] |
getHandshakeReservedBytes()
|
byte[] |
getId()
|
java.lang.String |
getIp()
Get the peer's local TCP connection port. |
PeerManager |
getManager()
|
int |
getMaximumNumberOfRequests()
|
int |
getNumberOfRequests()
|
int |
getPercentDone()
Deprecated. This erroneously returns percent in 1000 (i.e. 100% = 1000 :) Therefore replaces with something more accurately named! |
int |
getPercentDoneInThousandNotation()
|
int |
getPercentDoneOfCurrentIncomingRequest()
|
int |
getPercentDoneOfCurrentOutgoingRequest()
|
int |
getPort()
|
int[] |
getPriorityOffsets()
|
java.util.Map |
getProperties()
Get a set of properties associated with the peer |
java.util.List |
getRequests()
|
long |
getSnubbedTime()
|
int |
getState()
|
PeerStats |
getStats()
|
Message[] |
getSupportedMessages()
Get the list of messages that this peer and us mutually understand. |
int |
getTCPListenPort()
Get the TCP port this peer is listening for incoming connections on. |
int |
getUDPListenPort()
Get the UDP port this peer is listening for incoming connections on. |
int |
getUDPNonDataListenPort()
Get the UDP port this peer is listening on for non-data connections |
java.lang.Object |
getUserData(java.lang.Object key)
|
boolean |
isChoked()
|
boolean |
isChoking()
|
boolean |
isDownloadPossible()
This is much list isTransferAvailable(), except is more comprehensive. |
boolean |
isIncoming()
|
boolean |
isInterested()
|
boolean |
isInteresting()
|
boolean |
isOptimisticUnchoke()
|
boolean |
isPieceAvailable(int pieceNumber)
|
boolean |
isSeed()
|
boolean |
isSnubbed()
|
boolean |
isTransferAvailable()
|
int |
readBytes(int max)
Rate control - gives the maximum number of bytes that can be read from this connection at this time and returns the actual number read |
void |
removeListener(PeerListener listener)
Deprecated. use removeListener( PeerListener2 ) |
void |
removeListener(PeerListener2 listener)
Remove peer listener. |
void |
requestAllocationComplete()
|
boolean |
requestAllocationStarts(int[] base_priorities)
|
void |
setOptimisticUnchoke(boolean is_optimistic)
|
void |
setSnubbed(boolean b)
|
void |
setUserData(java.lang.Object key,
java.lang.Object value)
|
boolean |
supportsMessaging()
Whether or not this peer supports the advanced messaging API. |
int |
writeBytes(int max)
|
| Field Detail |
|---|
static final int CONNECTING
static final int HANDSHAKING
static final int TRANSFERING
static final int CLOSING
static final int DISCONNECTED
| Method Detail |
|---|
PeerManager getManager()
int getState()
byte[] getId()
java.lang.String getIp()
int getTCPListenPort()
int getUDPListenPort()
int getUDPNonDataListenPort()
int getPort()
boolean[] getAvailable()
boolean isPieceAvailable(int pieceNumber)
pieceNumber - int
boolean isTransferAvailable()
int readBytes(int max)
max -
int writeBytes(int max)
boolean isDownloadPossible()
boolean isChoked()
boolean isChoking()
boolean isInterested()
boolean isInteresting()
boolean isSeed()
boolean isSnubbed()
long getSnubbedTime()
void setSnubbed(boolean b)
PeerStats getStats()
boolean isIncoming()
int getPercentDone()
int getPercentDoneInThousandNotation()
java.lang.String getClient()
boolean isOptimisticUnchoke()
void setOptimisticUnchoke(boolean is_optimistic)
java.util.List getExpiredRequests()
java.util.List getRequests()
int getMaximumNumberOfRequests()
int getNumberOfRequests()
void cancelRequest(PeerReadRequest request)
boolean requestAllocationStarts(int[] base_priorities)
int[] getPriorityOffsets()
void requestAllocationComplete()
boolean addRequest(PeerReadRequest request)
void close(java.lang.String reason,
boolean closedOnError,
boolean attemptReconnect)
int getPercentDoneOfCurrentIncomingRequest()
int getPercentDoneOfCurrentOutgoingRequest()
void addListener(PeerListener listener)
listener - void removeListener(PeerListener listener)
listener - void addListener(PeerListener2 listener)
listener - void removeListener(PeerListener2 listener)
listener - Connection getConnection()
boolean supportsMessaging()
Message[] getSupportedMessages()
java.util.Map getProperties()
void setUserData(java.lang.Object key,
java.lang.Object value)
java.lang.Object getUserData(java.lang.Object key)
byte[] getHandshakeReservedBytes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||