This project is read-only.

How to receive the Speed of the download & How to stop the download?

Aug 11, 2013 at 11:41 AM
Hello,
Does SharpBits has implented a method to see the current speed of the download?
Does SharpBits has a method to stop a current download?
And:
I don't understand how to use the FileProgress | JobProgress events, how do
I use them?
When the download continues, does it use the FileProgress event or how does it works?
I hope you will be so nice, that you help me.
Greetings Feven
Aug 22, 2013 at 7:46 PM
as you may have experienced already, the BITS API raises FileProgress and JobProgress events as transfer occurs. You can subscribe to these events to monitor progress, but be aware these are raised at arbitrary intervals which can't be controlled. There is no direct indication of speed as part of these events, but you can check for the progress which is given in bytes, and you'll also know the overall size of each particular file/job which will help determining overall progress. You need yourself keep track of timestamps / event periods to determine "speed" out of this.

Sharpbits does support suspend/resume commands as document in the API (Suspend http://msdn.microsoft.com/en-us/library/windows/desktop/aa363048(v=vs.85).aspx, Resume http://msdn.microsoft.com/en-us/library/windows/desktop/aa363039(v=vs.85).aspx), else a download job can be cancelled at any time (Cancel http://msdn.microsoft.com/en-us/library/windows/desktop/aa363020(v=vs.85).aspx)