Hello.
I'd like to report this bad approach on the TCP Server and to ask for some workaround ideas.
I have a system capable of having thousands of files that WILL be listed if a tcp client issues the list command. Naturally it takes long time to the file system find all the files, which is natural.
When the client calls list operation, the main_TcpNet() doesn't return until the whole operation is done. This freezes the system for more than 10 secs.
The Keil's TCP Server should be able to perform the list operation in parts, probably returning from the main_TcpNet after each file is found.
So, how can I workaround this? I still want to use ftp for file transfer, also, I can't use a RTOS, it is a bare metal firmware.
(I am using MDK 4.22)
TCP server approach is not bad; in fact it is very good for a lightweight system. It is your job to process the client request in manageable chuck sizes that do not hug the processor for too long.
If he doesn't have multiple threads/tasks then he'll need to turn the implementation on it's head and use a more state-full approach so it doesn't block.
View all questions in Keil forum