Firstly, thanks for this project team! Well,I have a problem with the downlaod speed limit algorithm in the source code.
Assuming ,there are three transfer socket A, transfer socket B, and transfer socket C.
Now the speed limt is 3kb. A's nBytesAvialble is now 0 after some download transmission.B' and C' nBytesAvailbale is 1*1024 respectively .In source code,the average of 3kb among A,B,C is 1*1024 .and Because A's nBytesAvailable is zero ,A's nBytesAvailble is 1*1024 plus (B's and C'left nBytesAvailbale)/2 .So A's is (1*1024+1*1024).But A's nBytesAvailalbe exceeds the average 1*1024. To sum all of A,B and C 'nBytesAvailable,it exceeds the limit 3 kb.Why is it? I am curiously to fetch the answer.
Sincerely
Grant Fei
Client Speed limit algorithm?
Moderator: Project members
I've fixed a bug with the speed limit code in CVS. I'll release a fixed version during the next few days.
Anyhow, it's still possible for the total sum of nBytesAvailable to become greater than the limit. This happens if a transfer did not use up its assigned bandwidth. Assuming that this will be the case again in future, this is no problem.
In case speed did recover, in one time unit (currently one second) a little bit more than the assigned quota will exceed, by exactly the amount of bytes not transferred in the time unit before. So averaged about two time units the speed never exceeds the set limit.
Anyhow, it's still possible for the total sum of nBytesAvailable to become greater than the limit. This happens if a transfer did not use up its assigned bandwidth. Assuming that this will be the case again in future, this is no problem.
In case speed did recover, in one time unit (currently one second) a little bit more than the assigned quota will exceed, by exactly the amount of bytes not transferred in the time unit before. So averaged about two time units the speed never exceeds the set limit.