Good morning.
I'm testing an FTP server it based on Freescale demo.
Normally the system works perfectly.
The problem arises when I try special cases, in my case when I want to transfer a file, open the second ftps port and just before running the rtcs accept routines I break the connection of the client (by removing the Ethernet cable from the PC client side).
So the Kinetis does not go out of the rtcs accept's routine blocking the ftp server indefinitely.
Kindly you know how can I do to make this routine non-blocking?
thanks,
Michele
Hi Gian,
I recommend two options.
1. Modify the socket options for the socket like OPT_TIMEWAIT_TIMEOUT and see if this helps to get out of the accept due the timeout.
2. Use a watchdog for the task FTP task that runs for the data transfers. The task's name is "ftpsrv transfer". If the watchdog expires then kill the task.
Hope this helps.
Have a great day,
Garabo
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks for replay Garabo,
I have already changed OPT_TIMEWAIT_TIMEOUT option, but I don't get the expected results.
For the watchdog ok, but I can just close the socket passed to accept routine, I can't close the socket created by accept routine (I don't have the associated pointer).
I could close all sockets and restart FTP server, you know how can I close all open sockets and their areas of memory?
For this I test this answer Socket Accept abort behaviour problem but this code doesn't always work properly, sometimes it block FW in closing socket
Thank you in advance for availability
Hi.
Michele
Hi Michele,
I dig into the code and couldn't find a clean way to close all the open sockets in MQX. It would be necessary to implement such function/API that reads for all the sockets and close them. The only solution I see is to do a software reset.
Sorry I couldn't find a better approach.
Best Regards,
Garabo