<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MQX 4.1 RTCS PPP interface unbinding with FTP Client in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-RTCS-PPP-interface-unbinding-with-FTP-Client/m-p/397083#M13320</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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...).&lt;/P&gt;&lt;P&gt;The RTCS stack works well: using MQX FTP client the RTU upload/downloads files to a FTP server in the internet (static address).&lt;/P&gt;&lt;P&gt;When the PPP is linked, client&amp;nbsp; uses GPRS, otherwise client uses ethernet.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;The PPP interface is "unbind" and restarts correctly with a different local/remote IP Address (depends by operator "natting" policy).&lt;/P&gt;&lt;P&gt;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).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: for memory reasons&amp;nbsp; i have to wait for sockets close, timeout or shutdown before opening new connections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My questions are about socket philosophy and implementation:&lt;/P&gt;&lt;P&gt;1) Why when I "shutdown" an interface, connected sockets still remains "active"? I have to shutdown them manually? or is a TIMEOUT configuration problem?&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Francesco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Oct 2015 08:48:22 GMT</pubDate>
    <dc:creator>francescocontin</dc:creator>
    <dc:date>2015-10-22T08:48:22Z</dc:date>
    <item>
      <title>MQX 4.1 RTCS PPP interface unbinding with FTP Client</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-RTCS-PPP-interface-unbinding-with-FTP-Client/m-p/397081#M13318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In MQX 4.1 i'm running a PPP client application:&lt;/P&gt;&lt;P&gt;1) Open PPP&lt;/P&gt;&lt;P&gt;2) Open FTP Client&lt;/P&gt;&lt;P&gt;3) send STOR data....&lt;/P&gt;&lt;P&gt;4) Call PPP_release (or PPP linkdown) during data transmission&lt;/P&gt;&lt;P&gt;5) the PPP interface goes down (RTCS_if_unbind)&lt;/P&gt;&lt;P&gt;6) in RTCS Socket Summary: FTP client socket are still connected with the "unbinded" address (blocked in recv or send)&lt;/P&gt;&lt;P&gt;7) Restart PPP:a new interface address is assigned&lt;/P&gt;&lt;P&gt;8) FTP Client is still blocked with sockets in the old "unbinded" address... it seems an "half-open-like" deadlock&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A) how long the FTP Client sockets remains connected? forever?&lt;/P&gt;&lt;P&gt;B) how could I "shutdown" those sockets?&lt;/P&gt;&lt;P&gt;C) RTCS_if_unbind doesn't "shutdown" all interface sockets?&lt;/P&gt;&lt;P&gt;D) there is a "select_all by interface sockets and shutdown" RTCS function?&lt;/P&gt;&lt;P&gt;E) in a double interface application, when the ENET interface is active too, and socket sin_addr is ADDR_ANY, the only solution is to maintain a list of created socket and update interface bind (getsockname)?&lt;/P&gt;&lt;P&gt;F) at step 4 is generated a "MSGQ: queue is not open" task error: why? it's a problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Francesco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2015 14:11:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-RTCS-PPP-interface-unbinding-with-FTP-Client/m-p/397081#M13318</guid>
      <dc:creator>francescocontin</dc:creator>
      <dc:date>2015-10-14T14:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.1 RTCS PPP interface unbinding with FTP Client</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-RTCS-PPP-interface-unbinding-with-FTP-Client/m-p/397082#M13319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Francesco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure if I am getting the setup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Are you using FTP through PPP using NAT? Or FTP is connected through Ethernet and PPP has another purpose? &lt;/P&gt;&lt;P&gt;- What do you have in the other side of the PPP connection and what do you have in the other side of Ethernet link?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2015 20:13:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-RTCS-PPP-interface-unbinding-with-FTP-Client/m-p/397082#M13319</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2015-10-21T20:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.1 RTCS PPP interface unbinding with FTP Client</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-RTCS-PPP-interface-unbinding-with-FTP-Client/m-p/397083#M13320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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...).&lt;/P&gt;&lt;P&gt;The RTCS stack works well: using MQX FTP client the RTU upload/downloads files to a FTP server in the internet (static address).&lt;/P&gt;&lt;P&gt;When the PPP is linked, client&amp;nbsp; uses GPRS, otherwise client uses ethernet.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;The PPP interface is "unbind" and restarts correctly with a different local/remote IP Address (depends by operator "natting" policy).&lt;/P&gt;&lt;P&gt;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).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: for memory reasons&amp;nbsp; i have to wait for sockets close, timeout or shutdown before opening new connections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My questions are about socket philosophy and implementation:&lt;/P&gt;&lt;P&gt;1) Why when I "shutdown" an interface, connected sockets still remains "active"? I have to shutdown them manually? or is a TIMEOUT configuration problem?&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Francesco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 08:48:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-RTCS-PPP-interface-unbinding-with-FTP-Client/m-p/397083#M13320</guid>
      <dc:creator>francescocontin</dc:creator>
      <dc:date>2015-10-22T08:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.1 RTCS PPP interface unbinding with FTP Client</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-RTCS-PPP-interface-unbinding-with-FTP-Client/m-p/397084#M13321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Francesco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for instance I strongly recommend to use MQX4.2 and apply MQX4.2.0.1 and MQX4.2.0.2 patches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you say you must close sockets gracefully. If link is down unexpectedly the sockets will not be released. Please see chapter &lt;STRONG&gt;3.29 Shutting down stream sockets&lt;/STRONG&gt; of RTCS reference manual.&lt;/P&gt;&lt;P&gt;C:\Freescale\Freescale_MQX_4_2\doc\rtcs\MQX_RTCS_User_Guide.pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand, you can handle TIMEOUTS using setsockopt().&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Carlos&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2015 23:12:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-1-RTCS-PPP-interface-unbinding-with-FTP-Client/m-p/397084#M13321</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2015-11-03T23:12:23Z</dc:date>
    </item>
  </channel>
</rss>

