MQX 4.0 RTCS ftp accept blocking function

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX 4.0 RTCS ftp accept blocking function

932 Views
gianmichelepasi
Contributor II

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

Labels (1)
Tags (3)
0 Kudos
3 Replies

494 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

494 Views
gianmichelepasi
Contributor II

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

0 Kudos

494 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

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

0 Kudos