Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jul : Multiple Indy10 Components & Threading Question
| Subject: | Multiple Indy10 Components & Threading Question |
| Posted by: | "Jack MacRank" (ja..@macrank.com) |
| Date: | Sun, 16 Jul 2006 19:15:26 |
Remy,
You helped me with my last project (NNTP + Throttler) and it's working
perfectly...thanks for your expert help!
I'm working on my next project. It will use IdIRC, IdHTTP and IdHTTPServer
components. I want my app to connect to an IRC server and watch for a
certain command which triggers my app to download a file via HTTP and then
saves it in a folder where the built-in web server will host it. I have an
app already like this built with ICS and IPWorks components and I want to
redo it in Indy along with other modifications.
My only question is about threading:
First, from reading about the IdHTTPServer, it looks like it's already
threaded. So I can just drop it on the form and activate it. If I need to
call any VCL component then I need to use a custom PostMessage method (like
to keep a visual log in a TMemo on the form).
Second, I'll probably put the IdHTTP client component in its own thread so I
don't hog up the main thread while downloading.
Third, the IdIRC component. I should thread it just to keep it out of the
main thread probably. If I do, do you recommend using PostMessage or
Syncronize for all thread-to-thread calls?
Thanks for your help in advance!