Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
7.6k views
in .NET FTP by (1.9k points)
Can you please help post some code to explain how one can calculate speed per second. I know that to do that you need to handle the bytestransferred event by getting the total sent one second ago and compare it with the total sent now or something. Please help.

Thanks

12 Answers

0 votes
by (161k points)
I'll have to check this with our resident FTPConnection guru, but looking at the FTPConnection code I think it is trying to invoke the delegate/event on the main GUI thread.

Try setting UseGuiThreadIfAvailable to false.
0 votes
by (1.9k points)
Hello Bruce,

Thank you a lot. That resolved the problem alright.

When multiple upload threads are running and each is throttling bandwidth and calling the bytestransferred event handler. I see that a new problem arises. Each thread is making sure that the speed is throttled to for e.g. 256Kbps correctly. However, the end result is that the overall application upload speed is multiplied by the number of running threads. It is kind of a logic question here. What do you think is an efficient logic to control that and make sure no matter how much transfers are running in background, the total speed doesn't exceed 256Kbps?

Thanks in advance.

Categories

...