aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Unlimited upload speed and number of slots  (Read 2268 times)

woutermense

  • Full Member
  • ***
  • Karma: 18
  • Offline Offline
  • Posts: 154
Unlimited upload speed and number of slots
« on: December 09, 2008, 11:47:34 PM »

If i set upload speed to unlimited, how is the number of open upload slots determined?
Logged

gav616

  • Guest
Re: Unlimited upload speed and number of slots
« Reply #1 on: December 11, 2008, 04:17:18 PM »

[guessing]
current speed  / slot speed (while checking every so often)
[/guessing]
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Unlimited upload speed and number of slots
« Reply #2 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 {
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

woutermense

  • Full Member
  • ***
  • Karma: 18
  • Offline Offline
  • Posts: 154
Re: Unlimited upload speed and number of slots
« Reply #3 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
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Unlimited upload speed and number of slots
« Reply #4 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).
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon