<?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 change socket port when accept() is running in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-change-socket-port-when-accept-is-running/m-p/684484#M17419</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed this issue happens when you change/restart the socket from another task,&amp;nbsp; could you please check if this issue happens if you change/restart the socket from the same task?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Jul 2017 07:30:51 GMT</pubDate>
    <dc:creator>danielchen</dc:creator>
    <dc:date>2017-07-06T07:30:51Z</dc:date>
    <item>
      <title>MQX change socket port when accept() is running</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-change-socket-port-when-accept-is-running/m-p/684482#M17417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are using MQX 4.1 to provide ethernet&amp;nbsp;to a control board with&amp;nbsp;MK60FN1M0 microcontroller. We have implemented a web server, SNMP server and a TCP socket server and we found a problem with the last one when we try to change the port number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We initialize the socket server by using socket(), bind(), listen() and then accept(), as usual. The task holds on accept until client starts a connection. In this situation, we want to change the socket port and restart de original socket from another task.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have try to send (from another task):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; shutdown(currentTcpSocket,FLAG_ABORT_CONNECTION);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it seems not working. Actually, when we abort the socket and we watch de task list, TCP/IP task shows a "LWMEM_POOL INVALID" error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, any help will be appreciate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 09:13:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-change-socket-port-when-accept-is-running/m-p/684482#M17417</guid>
      <dc:creator>David_g1</dc:creator>
      <dc:date>2017-07-05T09:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: MQX change socket port when accept() is running</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-change-socket-port-when-accept-is-running/m-p/684483#M17418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Typically, a task is set to MQX_LWMEM_POOL_INVALID state when calling LWMEM related API. Please refer to the following code in lwmem.c&lt;/P&gt;&lt;P&gt;Since you are shutting down the socket, RTCS will immediately discard the socket and the socket's internal send and receive buffers. I would suggest you place a break point at the line where _task_set_error(MQX_LWMEM_POOL_INVALID) is located. And when it stops there, I guess you can get some information for analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/25105iA855B0CF1501DCEA/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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>Thu, 06 Jul 2017 07:26:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-change-socket-port-when-accept-is-running/m-p/684483#M17418</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2017-07-06T07:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: MQX change socket port when accept() is running</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-change-socket-port-when-accept-is-running/m-p/684484#M17419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed this issue happens when you change/restart the socket from another task,&amp;nbsp; could you please check if this issue happens if you change/restart the socket from the same task?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2017 07:30:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-change-socket-port-when-accept-is-running/m-p/684484#M17419</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2017-07-06T07:30:51Z</dc:date>
    </item>
  </channel>
</rss>

