Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Oct : Re: FTP upload stalling
| Subject: | Re: FTP upload stalling |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Fri, 19 Oct 2007 10:04:25 |
"Barry" <barry_morris@nospam.btinternet.com> wrote in message
news:4718a3cc@newsgroups.borland.com...
> I have used Indy10 in a project and have had reports that
> FTP upload is running slow and tests show that for no
> apparent reason FTP can stall for several seconds before
> resuming.
FTP uses multiple socket connections. Each upload/download runs on its own
dedicated connection. The delay could simply be how long it takes the OS to
establish that connection each time.
> I run FTP in its own thread with the main thread monitoring
> progress via a timer event. I use the IDFTP OnWork event to
> detect that something is actually happening and to provide
> data to the main thread for progress bars etc. using the
> Thread Synchronize method.
That in itself is going to significantly slow down your transfers, as you
are switching back to the main thread between each block of data that is
transmitted. I would not suggest using Synchronize() in this situation at
all. Use PostMessage(), PostThreadMessage(), or TIdNotify instead. Any of
those can be used to send asynchronous updates to the main thread, allowing
the transfer to continue forward without being blocked at all.
> I am using Indy 10 snapshot where idFTP.pas is dated 5 March 2007.
Have you tried upgrading to a newer snapshot since that date? You are using
a version that is 7 months old.
Gambit