What rev of the tools are you using?
I might try commenting out any of the code that is not simply reading (like writing to flash) and see if that makes a difference. Maybe the server is closing the connection on larger files because it thinks they are not read fast enough? You can determine that by a wireshark capture. Although in past projects we sent 1MB file and more with no problems at all.
FTP Get File help
Re: FTP Get File help
What platform are you using? Are you sure your not running of of flash space to store the file?
-
- Posts: 513
- Joined: Sat Apr 26, 2008 7:14 am
Re: FTP Get File help
Take a look at the description of ReadWithTimeout() in section 10.3 (in my version, on page 141) of C:\nburn\docs\NetBurnerRuntimeLibrary\NetBurnerRuntimeLibraries.pdf. It explains that the function returns -1 when the TCP connection is no longer valid. Sounds like Rixon may be correct in stating that the server might be closing the connection. I also agree with Rnixon to strip code down to just the read operation. Would it work if you send shorter binary files rather than text files?
What happens if you reduce FTP_BUFFER_SIZE? Is 500K of memory actually available; not sure? I think on the 5270 the total flash is 512K x 1024???
Also, you may want to look at whether the file should be fully buffered, line buffered or unbuffered. See setbuf() and setvbuf(). My guess would be unbuffered. Also, maybe an fflush() is needed to force characters to transfer??? Maybe the reason text files work is that they are line buffered and a newline char forces the transfer?
What happens if you reduce FTP_BUFFER_SIZE? Is 500K of memory actually available; not sure? I think on the 5270 the total flash is 512K x 1024???
Also, you may want to look at whether the file should be fully buffered, line buffered or unbuffered. See setbuf() and setvbuf(). My guess would be unbuffered. Also, maybe an fflush() is needed to force characters to transfer??? Maybe the reason text files work is that they are line buffered and a newline char forces the transfer?
Re: FTP Get File help
I am running on the SB70LC and have allocated memory range: FFC30000 to FFC80000 for the file system.
Re: FTP Get File help
Had my aha moment. Thank you all for your responses!
-
- Posts: 513
- Joined: Sat Apr 26, 2008 7:14 am
Re: FTP Get File help
And the answer was?