Link to home
Start Free TrialLog in
Avatar of Paer Toernell
Paer ToernellFlag for Thailand

asked on

Multi thread get TIdHTTP?

Im using Indy and delphi 2007, and trying to multithread the get funkton for TIdHTTP. I want to get 5 pages at the same time, but i get soome kind of socketerror when i use more than one thread. Am i on the wrong track or is it not possible to call 5 TIdHTTP at the same time?
Avatar of wd123
wd123
Flag of Belarus image

It's possible, show your code
Avatar of TheRealLoki
I have a demo which does exactly this. You can take a look at it, and disect it for your own purposes
http://sourceforge.net/projects/internetdemos
"HTTP Multi File Downloader"
Avatar of Paer Toernell

ASKER

Looks nice, but it wont compile:

[DCC Error] MultiFileDownloaderMain.pas(348): E2009 Incompatible types: 'Parameter lists differ'
[DCC Error] MultiFileDownloaderMain.pas(349): E2009 Incompatible types: 'Parameter lists differ'
[DCC Error] MultiFileDownloader.dpr(5): F2063 Could not compile used unit 'MultiFileDownloaderMain.pas'

line:
HTTPClientInsideAThread.OnWorkBegin := HTTPClientInsideThreadWorkBegin;
Different component versions?
I take it then, that you are using Indy 10
I'll see if I have time to can recompile it with Indy 10 and I'll post the code here
or you can do it yourself
basically, throw a TidHTTP on a blank form, double click on the OnWorkBegin, OnWork and OnWorkEnd events
copy the parameters in the event headers
(AProcess, ... etc)
and replace the ones in my unit with those
or just give me a day and I'll try to find time to do a Delphi 10 demo :-)

I gladly give u a day! Thanx!
ASKER CERTIFIED SOLUTION
Avatar of TheRealLoki
TheRealLoki
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
off topic: TheRealLoki
>> http://www.lakekiowa.com/lake-golf2.jpg
are you inviting ?
thnx!
> are you inviting ?
my golf skills are only slighlty better than my spelling :-(