|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: knowing download speed and ProgressIndicator [message #17230 is a reply to message #17228] |
Sun, 03 August 2008 14:53   |
TeCNoYoTTa
Messages: 138 Registered: July 2008 Location: Egypt
|
Experienced Member |
|
|
thanks Luzr for your reply
i will make more test cases and tell you
but i want to tell you what i want to do
i want to make a download manager that download files that are some times be attachments on forums
that allow visitors downloads also i want it to support pause/continue downloading
the proplem now is that the executeredirect dont complete downloading the file when the file is big
also i want to download part of file save it the download another part and save it to support
pause/continue
but executeredirect downloads all the file one piece and put it in a string variable
so these are the proplems
now i want to ask what does these functions do and what are there arguments and what they return
socket.WriteWait(const char *s,int length,int timeout_msec)
socket.Read()
socket.ReadUntil()
socket.ReadCount()
and i will get more test cases
but please help me or tell me how to find info
thanks in advance
and i am waiting your respond
[Updated on: Sun, 03 August 2008 14:55] Report message to a moderator
|
|
|
|
|
|
|
|