aMule Forum

English => aMule Help => Topic started by: woutermense on December 09, 2008, 11:47:34 PM

Title: Unlimited upload speed and number of slots
Post 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?
Title: Re: Unlimited upload speed and number of slots
Post by: gav616 on December 11, 2008, 04:17:18 PM
[guessing]
current speed  / slot speed (while checking every so often)
[/guessing]
Title: Re: Unlimited upload speed and number of slots
Post by: Stu Redman on December 11, 2008, 10:22:55 PM
Code: [Select]
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 {
Title: Re: Unlimited upload speed and number of slots
Post by: woutermense on December 12, 2008, 03:56:19 PM
So if I understand this code correctly it is all depending on this calculation:
Code: [Select]
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
Title: Re: Unlimited upload speed and number of slots
Post by: Stu Redman on December 14, 2008, 07:21:10 PM
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).