Class TransferMode
- java.lang.Object
-
- com.biglybt.core.speedmanager.impl.v2.TransferMode
-
public class TransferMode extends java.lang.Object
Is the application in a "download" mode? Or is it in a "seeding" mode? This is used to determine up we cut back on upload bandwidth limit. Here is how to determine the mode. If the download rate is LOW compared to the capacity for five minutes continously then it will be considered in a SEEDING mode. If the download bandwidth ever goes into the MED range then it switches to DOWNLOADING mode immediately. The application will favor DOWNLOADING mode to SEEDING mode.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
TransferMode.State
Java 1.4 enumeration.
-
Field Summary
Fields Modifier and Type Field Description private long
lastTimeDownloadDetected
private TransferMode.State
mode
private static long
WAIT_TIME_FOR_SEEDING_MODE
-
Constructor Summary
Constructors Constructor Description TransferMode()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransferMode.State
getMode()
java.lang.String
getString()
boolean
isConfTestingLimits()
We have two types of limit testing.boolean
isDownloadMode()
Are we in downloading mode?void
setMode(TransferMode.State newMode)
void
updateStatus(SaturatedMode downloadBandwidth)
If the download bandwidth is ever in MED or above switch immediately to DOWNLOADING mode.
-
-
-
Field Detail
-
mode
private TransferMode.State mode
-
lastTimeDownloadDetected
private long lastTimeDownloadDetected
-
WAIT_TIME_FOR_SEEDING_MODE
private static final long WAIT_TIME_FOR_SEEDING_MODE
- See Also:
- Constant Field Values
-
-
Method Detail
-
updateStatus
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.- Parameters:
downloadBandwidth
- - current download status.
-
getString
public java.lang.String getString()
-
getMode
public TransferMode.State getMode()
-
setMode
public void setMode(TransferMode.State newMode)
-
isDownloadMode
public boolean isDownloadMode()
Are we in downloading mode?- Returns:
- - boolean - true if in downloading mode. Otherwise false.
-
isConfTestingLimits
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.- Returns:
- - true if doing a "conf test of the limits"
-
-