Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ProgressBar while FTP retreive
#4
(05-19-2023, 03:11 AM)zsleo Wrote: TidAntiFreeze is in the ServerController.  

I'm not familiar with IntraWeb or how it works.  What thread does the ServerController run in?  TIdAntiFreeze does nothing if invoked in a worker thread.

(05-19-2023, 03:11 AM)zsleo Wrote: In my Main Form I have an TIWTimer and Button with its OnClick calls the following procedure

Why are you running a TTask that effectively does nothing?  All it does is Sleep() until gv_ToStop is True.  That is a useless waste of a worker thread.

(05-19-2023, 03:11 AM)zsleo Wrote: TIWTimer.Interval is set to 200 and the async event as follows

You are calling GetFile() (and thus running TIdFTP) in the context of the thread that fires the timer event, so you are blocking your timer while the FTP transfer is in progress, which is why the timer is not able to update your ProgressBar.

I strongly suggest that you move your FTP transfer logic to a separate worker thread. Do not block your timer handler.

Reply


Messages In This Thread
ProgressBar while FTP retreive - by zsleo - 05-18-2023, 03:51 AM
RE: ProgressBar while FTP retreive - by rlebeau - 05-18-2023, 07:54 PM
RE: ProgressBar while FTP retreive - by zsleo - 05-19-2023, 03:11 AM
RE: ProgressBar while FTP retreive - by rlebeau - 05-19-2023, 04:25 PM
RE: ProgressBar while FTP retreive - by zsleo - 05-22-2023, 06:04 AM
RE: ProgressBar while FTP retreive - by rlebeau - 06-22-2023, 05:19 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)