Methods Summary |
---|
public com.aelitis.azureus.core.speedmanager.impl.v2.TransferMode$State | getMode()
return mode;
|
public java.lang.String | getString()
return mode.getString();
|
public boolean | isConfTestingLimits()We have two types of limit testing. If we are doing a "confidence test" for the limits then
return true. This mode is putting one value at the min setting and the other at unlimited.
return ( mode==State.DOWNLOAD_LIMIT_SEARCH || mode==State.UPLOAD_LIMIT_SEARCH );
|
public boolean | isDownloadMode()Are we in downloading mode?
return ( mode==State.DOWNLOADING );
|
public void | setMode(com.aelitis.azureus.core.speedmanager.impl.v2.TransferMode$State newMode)
SpeedManagerLogger.trace( " setting transfer mode to: "+newMode.getString() );
mode = newMode;
|
public void | updateStatus(SaturatedMode downloadBandwidth)If the download bandwidth is ever in MED or above switch immediately to DOWNLOADING mode.
If th download bandwidth is LOW or less for more then 5 min, switch to SEEDING mode.
//this setting have no effect while testing the limits.
if( isConfTestingLimits() ){
if( mode==State.DOWNLOAD_LIMIT_SEARCH ){
lastTimeDownloadDetected = SystemTime.getCurrentTime();
}
return;
}
if( downloadBandwidth.compareTo(SaturatedMode.LOW)<=0 ){
//we don't seem to be downloading at the moment.
//see if this state has persisted for more then five minutes.
long time = SystemTime.getCurrentTime();
if( time > lastTimeDownloadDetected+WAIT_TIME_FOR_SEEDING_MODE ){
mode = State.SEEDING;
}
}else{
//Some downloading is happening. Remove from SEEDING mode.
mode = State.DOWNLOADING;
lastTimeDownloadDetected = SystemTime.getCurrentTime();
}
|