Re:TIdFTP, TIdAntiFreeze, multy Thread
Quote
> 1. If I made this in TThread is any thread need to have own TIdAntiFreeze,
> or this need to be only one in Application
If you put it in threads, you don't need TIdAntiFreeze at all. It's just for
avoiding blocks of the GUI when using Indy in the main thread
Quote
> 2. TThread Question :
> How I can kill Thread if this never finish Execute ?
> MyThread.Terminate; from main Thread don't kill thread and TIdFtp continue
> download, what i doing wrong ?
You need to abort the downloading manually.
Terminate only sets a flag, but does not interrupt anything. Call terminate
and then call TIdFTP.Abort or TIdFTP.Quit, or maybe even TIdFTP.CloseSocket.
But the thread will only terminate, if Execute has been completely executed.
So, your execute procedure should either look like (pseudo-code):
begin
// do stuff
TidFTP.Download
//maybe some cleanup, but nothing that blocks
end
It is your task to make the thread finish the execute procedure.
There are way of interrupting threads manually, but that should not be used
as the normal way of terminating a thread.
Andy