aMule Forum
English => aMule Help => Topic started by: woutermense on December 09, 2008, 11:47:34 PM
-
If i set upload speed to unlimited, how is the number of open upload slots determined?
-
[guessing]
current speed / slot speed (while checking every so often)
[/guessing]
-
bool CUploadQueue::AcceptNewClient()
{
...
float kBpsUpPerClient = (float)thePrefs::GetSlotAllocation();
float kBpsUp = theStats::GetUploadRate() / 1024.0f;
if (thePrefs::GetMaxUpload() == UNLIMITED) {
if (m_uploadinglist.size() < ((uint32)((kBpsUp)/kBpsUpPerClient)+2)) {
return true;
}
} else {
-
So if I understand this code correctly it is all depending on this calculation:
m_uploadinglist.size() < ((uint32)((kBpsUp)/kBpsUpPerClient)+2)
Where:
m_uploadinglist.size() = The number of clients aMule is currently uploading to.
kBpsUp = Bandwidth of your upload pipe that is normally only used for the statistics. (Was moved from preferences:connection to preferences:statistics since 2.2.2?)
kBpsUpPerClient = Slot bandwith
-
No, kBpsUp is the currently measured UL rate. The key feature is the little innocent +2.
At startup, there are 0 clients and 0 upload, so two clients can be added. kBpsUp starts increasing, so more and more clients can be added. This goes on until UL reaches the limit. Then the client number stops too (with two more clients, so they get a little less than slot speed if everybody can DL at full speed).