<?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 TCP child task gets stuck at send() in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/TCP-child-task-gets-stuck-at-send/m-p/907722#M18214</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MQX ver. 4.1.1.&lt;/P&gt;&lt;P&gt;I made a daemon server to treat incoming TCP connections as suggested in many posts by NXP mods. I set a limit of connections to 5 using my own solution and that's working alright. The problem i have tho is that sometimes (it's not always and i have to make multiple tests to make it happen) all the child tasks that have a socket each gets stuck at send().&lt;/P&gt;&lt;P&gt;my socket options:&lt;/P&gt;&lt;P&gt;#define TESTSOCKET_BUFFER_SIZE 256&lt;BR /&gt;#define TESTSOCKET_NOWAIT FALSE&lt;BR /&gt;#define TESTSOCKET_SEND_TIMEOUT 10000&lt;BR /&gt;#define TESTSOCKET_CONNECT_TIMEOUT 1000&lt;BR /&gt;#define TESTSOCKET_TIMEWAIT_TIMEOUT 1000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm using a shell script to check if my packages are being recieved:&lt;/P&gt;&lt;P&gt;&amp;nbsp; for((i=1;i&amp;lt;=5;i++))&lt;BR /&gt;&amp;nbsp; do &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo msg | netcat 192.168.41.100 22222 &amp;gt; ${i}.log&amp;amp; &lt;BR /&gt;&amp;nbsp; done&amp;nbsp;&lt;/P&gt;&lt;P&gt;my test child task will send 10 messages in sequence and then shutdown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sometimes the child tasks will get stuck, after about 3min it gets unstuck and it returns the error 0x1635 which means TCP: Software caused connection abort.&lt;/P&gt;&lt;P&gt;Looking further in wireshark, when the stuck occurs it seems the device sends a TCP Zero Window, it seems the device does not have what it takes to send all the messages in a short time, but is there a way to circumvent this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 May 2019 15:23:00 GMT</pubDate>
    <dc:creator>alvaro_oliveira</dc:creator>
    <dc:date>2019-05-24T15:23:00Z</dc:date>
    <item>
      <title>TCP child task gets stuck at send()</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TCP-child-task-gets-stuck-at-send/m-p/907722#M18214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MQX ver. 4.1.1.&lt;/P&gt;&lt;P&gt;I made a daemon server to treat incoming TCP connections as suggested in many posts by NXP mods. I set a limit of connections to 5 using my own solution and that's working alright. The problem i have tho is that sometimes (it's not always and i have to make multiple tests to make it happen) all the child tasks that have a socket each gets stuck at send().&lt;/P&gt;&lt;P&gt;my socket options:&lt;/P&gt;&lt;P&gt;#define TESTSOCKET_BUFFER_SIZE 256&lt;BR /&gt;#define TESTSOCKET_NOWAIT FALSE&lt;BR /&gt;#define TESTSOCKET_SEND_TIMEOUT 10000&lt;BR /&gt;#define TESTSOCKET_CONNECT_TIMEOUT 1000&lt;BR /&gt;#define TESTSOCKET_TIMEWAIT_TIMEOUT 1000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm using a shell script to check if my packages are being recieved:&lt;/P&gt;&lt;P&gt;&amp;nbsp; for((i=1;i&amp;lt;=5;i++))&lt;BR /&gt;&amp;nbsp; do &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo msg | netcat 192.168.41.100 22222 &amp;gt; ${i}.log&amp;amp; &lt;BR /&gt;&amp;nbsp; done&amp;nbsp;&lt;/P&gt;&lt;P&gt;my test child task will send 10 messages in sequence and then shutdown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sometimes the child tasks will get stuck, after about 3min it gets unstuck and it returns the error 0x1635 which means TCP: Software caused connection abort.&lt;/P&gt;&lt;P&gt;Looking further in wireshark, when the stuck occurs it seems the device sends a TCP Zero Window, it seems the device does not have what it takes to send all the messages in a short time, but is there a way to circumvent this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2019 15:23:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TCP-child-task-gets-stuck-at-send/m-p/907722#M18214</guid>
      <dc:creator>alvaro_oliveira</dc:creator>
      <dc:date>2019-05-24T15:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: TCP child task gets stuck at send()</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TCP-child-task-gets-stuck-at-send/m-p/907723#M18215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-content-finding="Community" data-userid="341950" data-username="alvaro.oliveira@nhs.com.br" href="https://community.nxp.com/people/alvaro.oliveira@nhs.com.br"&gt;Alvaro&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This issue is very similar to below issue&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/83942iB1D0D977B753847F/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This issue is fixed in MQX 4.2.0.2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest you update to MQX 4.2.0 and patched with mqx 4.2.0.2.&amp;nbsp;&amp;nbsp; This version fixed some RTCS issues.&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;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2019 03:31:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TCP-child-task-gets-stuck-at-send/m-p/907723#M18215</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2019-05-28T03:31:17Z</dc:date>
    </item>
  </channel>
</rss>

