moore_it Well-Known Member Licensed User Longtime User Nov 25, 2014 #1 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
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
Erel B4X founder Staff member Licensed User Longtime User Nov 25, 2014 #2 Can you post your code? Upvote 0
moore_it Well-Known Member Licensed User Longtime User Nov 25, 2014 #3 sure Attachments BADAMA.zip BADAMA.zip 216.2 KB · Views: 422 Upvote 0
moore_it Well-Known Member Licensed User Longtime User Nov 25, 2014 #4 This code work fine in debug, infinite loop in release Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 25, 2014 #5 Can you try to build a small project with only the relevant FTP code that reproduces this issue? Where exactly is the infinite loop? In FTP_DownloadCompleted? Upvote 0
Can you try to build a small project with only the relevant FTP code that reproduces this issue? Where exactly is the infinite loop? In FTP_DownloadCompleted?
moore_it Well-Known Member Licensed User Longtime User Nov 25, 2014 #6 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
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 ...
moore_it Well-Known Member Licensed User Longtime User Nov 25, 2014 #7 if i insert a for cycle type in ftp_DownloadCompleted for i = 0 to 100000000 next also in release work fine .... Upvote 0
if i insert a for cycle type in ftp_DownloadCompleted for i = 0 to 100000000 next also in release work fine ....
Erel B4X founder Staff member Licensed User Longtime User Nov 26, 2014 #8 moore_it said: 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 ... Click to expand... Please try to reproduce it in a new project with only the FTP related code. Upvote 0
moore_it said: 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 ... Click to expand... Please try to reproduce it in a new project with only the FTP related code.
moore_it Well-Known Member Licensed User Longtime User Nov 27, 2014 #9 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 TestFTP.zip 2 KB · Views: 434 Upvote 0
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
Erel B4X founder Staff member Licensed User Longtime User Nov 27, 2014 #10 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: Code: Copy 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
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: Code: Copy 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.
moore_it Well-Known Member Licensed User Longtime User Nov 27, 2014 #11 Ok thanks i try without timer. Upvote 0
moore_it Well-Known Member Licensed User Longtime User Nov 28, 2014 #12 Yes you've right ! It's work fine without timer. Thanks. Upvote 0