Methods Summary |
---|
public int | getLevel()
return level;
|
public int | getPieceNumber()
return pieceNumber;
|
public void | peerHasPiece(org.gudy.azureus2.core3.peer.PEPeer peer)
try{
class_mon.enter();
if(level < 2) {
firstReceiver = peer;
timeFirstDistributed = SystemTime.getCurrentTime();
//numberOfPeersWhenFirstReceived = manager.getNbPeers();
} else {
if(peer != null && firstReceiver != null) {
timeToReachAnotherPeer = (int) (SystemTime.getCurrentTime() - timeFirstDistributed);
firstReceiver.setUploadHint(timeToReachAnotherPeer);
}
}
level = 2;
}finally{
class_mon.exit();
}
|
public void | peerLeft()
if(level == 1)
level = 0;
|
public void | pieceRevealedToPeer()
try{
class_mon.enter();
level = 1;
}finally{
class_mon.exit();
}
|
public void | updateTime()
if(level < 2)
return;
if(timeToReachAnotherPeer > 0)
return;
if(firstReceiver == null)
return;
int timeToSend = (int) (SystemTime.getCurrentTime() - timeFirstDistributed);
if(timeToSend > firstReceiver.getUploadHint())
firstReceiver.setUploadHint(timeToSend);
|