Hi Carlos
it's a K64 RTU with two interfaces: the ENET (phy) and PPP (through serial tty connected to a SIM900 GSM/GPRS Modem with a data SIM etc...).
The RTCS stack works well: using MQX FTP client the RTU upload/downloads files to a FTP server in the internet (static address).
When the PPP is linked, client uses GPRS, otherwise client uses ethernet.
The problem is when I have to disconnect the Modem (daily) and stop/restart PPP (intentionally disconnection), or when the PPP/GPRS connection links down (unintentionally disconnection) during PPP operations.
The PPP interface is "unbind" and restarts correctly with a different local/remote IP Address (depends by operator "natting" policy).
BUT sockets created and connected running with the old PPP interface (old local address) still remains active in a unpredictable state (could be sendind/receiving) forever (or could be hours), MORE than the default timeout times (i think about 8' or 4', see FTP client socket configuration).
Note: for memory reasons i have to wait for sockets close, timeout or shutdown before opening new connections.
My questions are about socket philosophy and implementation:
1) Why when I "shutdown" an interface, connected sockets still remains "active"? I have to shutdown them manually? or is a TIMEOUT configuration problem?
2) sockets are created in MQX RTCS Application by the FTP client task (and functions): for an "outside" control there is a "select by interface and shutdown" comand, or a way to implement a similar command (if is appropriate or useful), something like the RTCS_selectall.
3) the only solution is to collect and maintain a list of running sockets on the different interfaces and then shutdown them when PPP links down?
Best Regards
Francesco