Re: Kinda lost!

Giganews Newsgroups
Subject: Re: Kinda lost!
Posted by:  Remy Lebeau (Indy Team) (
Date: Tue, 3 Oct 2006

"Clément Doss" <> wrote in message

> If I select more than 2 files, I most certainly will have a problem.

No, you won't.  It will work fine.

> Then program starts the FTP, but just stops.

Then you are not using it properly.  Please show your actual code.

> When I check the server, there's a "Closed connection. Transfer aborted".
> But the line *Synchronize(StatusEnd);* is not executed, and I this thread
> remains active until the programs closes.

The only way that can happen is if the TIdFTP is not able to detect the
abort.  Assuming the server is the one closing the connection to begin with.

> Of course, if I try to download one file things works, no matter if
> the files is small 345 Kbytes or big 140 Mbytes.).

The file size is irrelevant in this situation.

> When there are big transfers (>80Mb), the thread "stops" for a
> while (I guess inside FFTP.Get) then executes
> *Synchronize(StatusEnd);*

As it should be.  Yes, Get() is a blocking method that will not exit until
the transfer is finished.  You need to use the OnWork events to get status
on the actual transfer.

> Is there a way to detect that the connection was closed by the server?

Get() will throw an exception accordingly when that happens, provided that
the server is closing the socket properly in the first place.  Otherwise,
you will have to specific a read timeout instead.



In response to

Kinda lost! posted by Clément_Doss on Tue, 03 Oct 2006