|
|
Home » U++ Library support » U++ MT-multithreading and servers » knowing download speed and ProgressIndicator
|
|
|
|
|
|
|
Re: knowing download speed and ProgressIndicator [message #16962 is a reply to message #16918] |
Wed, 23 July 2008 13:41   |
mr_ped
Messages: 826 Registered: November 2005 Location: Czech Republic - Praha
|
Experienced Contributor |
|
|
Run new thread/instance of HttpClient for every URL you want to download together.
Create your own progress indicator with "bool MethodToGatherData(int, int)" in it.
Set this method as callback to every HttpClient during ExecuteRedirect call.
In that method find out a way to gather multiple data from different threads, calculate some nice numbers out of them, and show them as progress bar.
No source code this time, I'm too new into this topic to write it from head, and I have to work on different things. I think that's the reason for slow answers from others too, while you are free to ask, others are free to (not) answer, as their free time and skill allows them. If you want to learn C++,U++ and do your own application, just study hard and have patience (and keep asking, but also keep searching for answer on your own). If you want the app done fast, pay Mirek or some skilled other UPP developer.
|
|
|
Re: knowing download speed and ProgressIndicator [message #17157 is a reply to message #16962] |
Thu, 31 July 2008 20:22   |
TeCNoYoTTa
Messages: 138 Registered: July 2008 Location: Egypt
|
Experienced Member |

|
|
thanks all
i did this but there is an error
void Download_Manager_Window::progress_indecator(int x, int all)
{
static int timer = 0;
static int data = 0;
progress_bar.Set(x,all);
timer = clock() - timer;
data = x - data;
label_DownloadSpeed.SetText(DblStr((data/timer) * 1.0 ) + " KB/S");
timer = clock();
data = x;
}
void Download_Manager_Window::Download_File(String link)
{
client.URL(link);
client.Execute(THISBACK( progress_indecator ));
}
this is the error
D:\Program Files\MyApps\CISL\main.cpp:57: error: 'progress_indecator' is not a member of 'Upp::TopWindow'
[Updated on: Thu, 31 July 2008 20:25] Report message to a moderator
|
|
|
|
Re: knowing download speed and ProgressIndicator [message #17168 is a reply to message #17161] |
Fri, 01 August 2008 09:17   |
TeCNoYoTTa
Messages: 138 Registered: July 2008 Location: Egypt
|
Experienced Member |

|
|
thanks
i tried what you said but there still errors this is the code
void Download_Manager_Window::progress_indecator(int x, int all)
{
static int timer = 0;
static int data = 0;
progress_bar.Set(x,all);
timer = clock() - timer;
data = x - data;
label_DownloadSpeed.SetText(DblStr((data/timer) * 1.0 ) + " KB/S");
timer = clock();
data = x;
}
void Download_Manager_Window::Download_File(String link)
{
client.URL(link);
client.ExecuteRedirect(HttpClient::DEFAULT_MAX_REDIRECT,HttpClient::DEFAULT_RETRIES,THISBACK( progress_indecator ));
}
and this is the error
D:\Program Files\MyApps\CISL\main.cpp: In member function 'void Download_Manager_Window::Download_File(Upp::String)':
D:\Program Files\MyApps\CISL\main.cpp:60: error: no matching function for call to 'Upp::HttpClient::ExecuteRedirect(Upp::HttpClient::<anon
ymous enum>, Upp::HttpClient::<anonymous enum>, Upp::Callback2<int, int>)'
D:\Program Files\upp\uppsrc/Web/httpcli.h:41: note: candidates are: Upp::String Upp::HttpClient::ExecuteRedirect(int, int, Upp::Gate2<int,
int>)
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri May 09 15:44:31 CEST 2025
Total time taken to generate the page: 0.01164 seconds
|
|
|