iOS Question FTP question

moore_it

Well-Known Member
Licensed User
Longtime User
Hi all,

when i download several files from and ftp server, my program in debug works fine, instead in release mode download some files and waiting forever :)
I need to slow the download process with a for cycle ...

It's true ?
Or a bug ?

Thanks
 

moore_it

Well-Known Member
Licensed User
Longtime User
when i try in debug mode the FTP_DownloadCompleted work fine i don't know where is the loop.
If you want i give you ma server account for testing ...
 
Upvote 0

moore_it

Well-Known Member
Licensed User
Longtime User
if i insert a for cycle type in ftp_DownloadCompleted

for i = 0 to 100000000
next

also in release work fine ....
 
Upvote 0

moore_it

Well-Known Member
Licensed User
Longtime User
Hi,i hope this work.
Not tested on ios device, not have in this moment.

please select a ftp folder with 80 or plus files

Thanks
 

Attachments

  • TestFTP.zip
    2 KB · Views: 228
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
There are several problems in your code:
1. 1ms interval is too short for a timer. It may cause the main thread to be blocked by this timer.
2. Your code actually creates many timers with this interval:
B4X:
Case "WP" 'work in progress
     myTimer.Initialize("tim",1)
     myTimer.Enabled = True
You are creating a new timer with this interval each tick. You don't need to initialize a new timer for the timer to continue ticking.

3. It is not really a problem however the timer is not needed here at all. Use the DownloadCompleted event to update whatever you want to update.
 
Upvote 0
Top