<?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>MQX Software SolutionsのトピックRe: Embedded server</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215991#M5538</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;I am sorry but I would need more details about what you want to accomplish.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This server will accept connections from any client that is connected in the same LAN.&lt;/P&gt;&lt;P&gt;QUICK NOTE:&lt;/P&gt;&lt;P&gt;Make sure that you are not giving the same IP address and MAC address to the client and server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Garabo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Dec 2014 17:34:58 GMT</pubDate>
    <dc:creator>Luis_Garabo</dc:creator>
    <dc:date>2014-12-12T17:34:58Z</dc:date>
    <item>
      <title>Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215986#M5533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hello, i have been doing the development for a Embedded server for multiple client. i developed the code.....unfortunately...no one in my surrounding have worked with MQX + RTCS + Ethernet and i am new born for it. so i need your valuable suggestion for the same, just need to confirm that what i am doing is on good path:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i want to do:&lt;/P&gt;&lt;P&gt;create a server with 12 ports to connect one client each port. for data transmission and reciption.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the Server task: i have written, logic flow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. first i created the socket's (all 12) assign them with a predefined Port.&lt;/P&gt;&lt;P&gt;2. in infinte while loop &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i. child_sock = RTCS_selectall(0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ii. child_sock = accept(listensock[0], NULL, NULL); // similarly for others ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; after accept RTCS_detachsock the socket&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create a new task attach the socket with RTCS_attachsock &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 11:24:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215986#M5533</guid>
      <dc:creator>Swapnil_Enable</dc:creator>
      <dc:date>2012-12-21T11:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215987#M5534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swapnil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you are trying to implement is what usually is called Daemon Server. I developed one of these some time ago. I am attaching here. I hope helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-Garabo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2013 02:29:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215987#M5534</guid>
      <dc:creator>Luis_Garabo</dc:creator>
      <dc:date>2013-01-31T02:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215988#M5535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for response Garabo. u mention that u have attached some related work. but i am unable to see it. meanwhile, i have created the code what i mention above. still not sure abt the memory calculation for the task and sockets as i have to add this with my project in 512kb code memory of mk60n512 controller. please suggest what can i do to understand it. Regards, Swapnil K.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 07:39:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215988#M5535</guid>
      <dc:creator>Swapnil_Enable</dc:creator>
      <dc:date>2013-02-01T07:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215989#M5536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swapnil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is weird that you can’t see the attachment. I can see it right there after the text of my posting. What internet explorer are you using, Firefox, Microsoft?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding socket memory allocation...With the TaskAwareDebugging, you can see that every new TCP socket connection needs extra 500+4392x2+148=9432B/59.0KB=16% as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MQX -&amp;gt; Lightweight Memory Block Summary Size (Decimal) Owner&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&lt;/P&gt;&lt;P&gt;500&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x10001&amp;nbsp; TCP Control Block;RTCS/TCP&lt;/P&gt;&lt;P&gt;4392&amp;nbsp;&amp;nbsp; 0x10001&amp;nbsp; TCP Tx Window;RTCS/TCP&lt;/P&gt;&lt;P&gt;4392&amp;nbsp;&amp;nbsp; 0x10001&amp;nbsp; TCP Rx Window;RTCS/TCP&lt;/P&gt;&lt;P&gt;148&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x10001&amp;nbsp; TCP Send Clock;RTCS/TCP&lt;/P&gt;&lt;P&gt;(TCP/IP Task id is 0x10001)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The default OPT_TBSIZE and OPT_RBSIZE are 4380 bytes. If you call setsockopt() to reduce these two, for example, to a quarter like 1095 bytes, the memory usage to open a new TCP socket will drop from 16% to 4.7% as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MQX -&amp;gt; Lightweight Memory Block Summary Size (Decimal) Owner&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&lt;/P&gt;&lt;P&gt;500&amp;nbsp; -&amp;gt;&amp;nbsp; 500&amp;nbsp;&amp;nbsp; 0x10001&amp;nbsp; TCP Control Block;RTCS/TCP&lt;/P&gt;&lt;P&gt;4392 -&amp;gt; 1108&amp;nbsp;&amp;nbsp; 0x10001&amp;nbsp; TCP Tx Window;RTCS/TCP&lt;/P&gt;&lt;P&gt;4392 -&amp;gt; 1108&amp;nbsp;&amp;nbsp; 0x10001&amp;nbsp; TCP Rx Window;RTCS/TCP&lt;/P&gt;&lt;P&gt;148&amp;nbsp; -&amp;gt;&amp;nbsp;&amp;nbsp; 84&amp;nbsp;&amp;nbsp; 0x10001&amp;nbsp; TCP Send Clock;RTCS/TCP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the problem persists please set a slower number, try next: &lt;/P&gt;&lt;P&gt;uint_32 value;&lt;/P&gt;&lt;P&gt;… &lt;/P&gt;&lt;P&gt;value = 256; &lt;/P&gt;&lt;P&gt;setsockopt(sock, SOL_TCP,OPT_TBSIZE,&amp;amp;value,sizeof(value)); &lt;/P&gt;&lt;P&gt;setsockopt(sock, SOL_TCP,OPT_RBSIZE,&amp;amp;value,sizeof(value)); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, it might be possible that you need more PCBs, MSG and sockets. Could you please add the next lines just before call the function RTCS_create() just as the web_hvac does in the C:\Program Files\Freescale\Freescale MQX 3.5\demo\web_hvac\RTCS.c file?&lt;/P&gt;&lt;P&gt;/* runtime RTCS configuration */&lt;/P&gt;&lt;P&gt;_RTCSPCB_init = 4; &lt;/P&gt;&lt;P&gt;_RTCSPCB_grow = 2; &lt;/P&gt;&lt;P&gt;_RTCSPCB_max = 20; &lt;/P&gt;&lt;P&gt;_RTCS_msgpool_init = 4; &lt;/P&gt;&lt;P&gt;_RTCS_msgpool_grow = 2; &lt;/P&gt;&lt;P&gt;_RTCS_msgpool_max = 20; &lt;/P&gt;&lt;P&gt;_RTCS_socket_part_init = 4; &lt;/P&gt;&lt;P&gt;_RTCS_socket_part_grow = 2; &lt;/P&gt;&lt;P&gt;_RTCS_socket_part_max = 20;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this to see if you can get more resources. I hope this helps. Have a nice day.&lt;/P&gt;&lt;P&gt; -Garabo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 21:32:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215989#M5536</guid>
      <dc:creator>Luis_Garabo</dc:creator>
      <dc:date>2013-04-01T21:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215990#M5537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have copied your basic server code to my project and the problem I am having is that the while loop&lt;/P&gt;&lt;P&gt;continues to connect to the same IP address creating multiple connections of serverCTask. I have done this&lt;/P&gt;&lt;P&gt;in a Linux environment but MQX 4.1 seems to have its own unique requirements. I can't test for IP address&lt;/P&gt;&lt;P&gt;similarities and delete the connections. That would eat up valuable resources. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 19:39:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215990#M5537</guid>
      <dc:creator>davidsa</dc:creator>
      <dc:date>2014-12-11T19:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215991#M5538</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;I am sorry but I would need more details about what you want to accomplish.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This server will accept connections from any client that is connected in the same LAN.&lt;/P&gt;&lt;P&gt;QUICK NOTE:&lt;/P&gt;&lt;P&gt;Make sure that you are not giving the same IP address and MAC address to the client and server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Garabo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2014 17:34:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215991#M5538</guid>
      <dc:creator>Luis_Garabo</dc:creator>
      <dc:date>2014-12-12T17:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215992#M5539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is a section of code. Basically what is going on when a device with for example IP 172.22.1.32 on port 512&lt;/P&gt;&lt;P&gt;will connect create a task result = &lt;U&gt;task&lt;/U&gt;create(0, ModBus_C_TASK, child_sock); and pass in the child client&lt;/P&gt;&lt;P&gt;that just connected. The while loop will loop back around and the same IP 172.22.1.32 will again connect create&lt;/P&gt;&lt;P&gt;another task task result = &lt;U&gt;task&lt;/U&gt;create(0, ModBus_C_TASK, child_sock); and so on. the printf "Client dispatched…"&lt;/P&gt;&lt;P&gt;will print every second. Constantly creating new tasks task result = &lt;U&gt;task&lt;/U&gt;create(0, ModBus_C_TASK, child_sock);…………….&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         listensock_one = socket(AF_INET, SOCK_STREAM, 0);//PF_INET&lt;/P&gt;&lt;P&gt;         if (listensock_one == RTCS_SOCKET_ERROR)&lt;/P&gt;&lt;P&gt;         {&lt;/P&gt;&lt;P&gt;           error = RTCSERR_OUT_OF_SOCKETS;&lt;/P&gt;&lt;P&gt;           shutdown(listensock_one, FLAG_ABORT_CONNECTION);//FLAG_CLOSE_TX);&lt;/P&gt;&lt;P&gt;           statusWord= 0x0800;&lt;/P&gt;&lt;P&gt;           //printf("Fg");&lt;/P&gt;&lt;P&gt;           return;&lt;/P&gt;&lt;P&gt;         }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         BufferValue = 512; // 512 bytes send and receive&lt;/P&gt;&lt;P&gt;         setsockopt(listensock_one, SOL_TCP,OPT_TBSIZE,&amp;amp;BufferValue,sizeof(BufferValue));&lt;/P&gt;&lt;P&gt;         setsockopt(listensock_one, SOL_TCP,OPT_RBSIZE,&amp;amp;BufferValue,sizeof(BufferValue));&lt;/P&gt;&lt;P&gt;       // BufferValue = TRUE;&lt;/P&gt;&lt;P&gt;       // setsockopt(listensock_one, SOL_TCP,OPT_RECEIVE_NOWAIT,&amp;amp;BufferValue,sizeof(BufferValue));&lt;/P&gt;&lt;P&gt;        // setsockopt(listensock_one, SOL_TCP,OPT_NO_NAGLE_ALGORITHM,&amp;amp;BufferValue,sizeof(BufferValue));&lt;/P&gt;&lt;P&gt;        // BufferValue = 5000;//ms&lt;/P&gt;&lt;P&gt;       //  setsockopt(listensock_one, SOL_TCP,OPT_CONNECT_TIMEOUT,&amp;amp;BufferValue,sizeof(BufferValue));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         //BufferValue = 1;//ms&lt;/P&gt;&lt;P&gt;         //setsockopt(listensock_one, SOL_TCP,OPT_KEEPALIVE,&amp;amp;BufferValue,sizeof(BufferValue));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         BufferValue = 100;&lt;/P&gt;&lt;P&gt;          setsockopt(listensock_one, SOL_TCP,OPT_TIMEWAIT_TIMEOUT,&amp;amp;BufferValue,sizeof(BufferValue));&lt;/P&gt;&lt;P&gt;         error = bind(listensock_one, &amp;amp;laddr, sizeof(laddr));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         if (!error)&lt;/P&gt;&lt;P&gt;         {&lt;/P&gt;&lt;P&gt;                statusWord= 0x0400;&lt;/P&gt;&lt;P&gt;                //printf("RR"); // socket initial bind, TCP READY&lt;/P&gt;&lt;P&gt;                error = listen(listensock_one, 0);&lt;/P&gt;&lt;P&gt;         }&lt;/P&gt;&lt;P&gt;         else&lt;/P&gt;&lt;P&gt;         {&lt;/P&gt;&lt;P&gt;                shutdown(listensock_one, FLAG_ABORT_CONNECTION);//FLAG_CLOSE_TX);&lt;/P&gt;&lt;P&gt;                statusWord= 0x0500;&lt;/P&gt;&lt;P&gt;                //printf("Fb");    // TCP failed to bind&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                RTCS_detachsock(listensock_one);&lt;/P&gt;&lt;P&gt;                return;&lt;/P&gt;&lt;P&gt;         }&lt;/P&gt;&lt;P&gt;         uint_16                    remote_addr_len;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         &lt;U&gt;time&lt;/U&gt;delay(250);&lt;/P&gt;&lt;P&gt;         remote_addr_len = sizeof(remote_addr);&lt;/P&gt;&lt;P&gt;         do&lt;/P&gt;&lt;P&gt;         {&lt;/P&gt;&lt;P&gt;                //child_sock = RTCS_selectall(0);&lt;/P&gt;&lt;P&gt;                statusWord= 0x1000;      //ModBusServerTask waiting to connect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                child_sock = accept(listensock_one, &amp;amp;remote_addr, &amp;amp;remote_addr_len);//accept(listensock, &amp;amp;remote_addr, &amp;amp;remote_addr_len);&lt;/P&gt;&lt;P&gt;                if (child_sock==RTCS_SOCKET_ERROR)&lt;/P&gt;&lt;P&gt;                {&lt;/P&gt;&lt;P&gt;                       shutdown((uint_32)child_sock, FLAG_ABORT_CONNECTION);&lt;/P&gt;&lt;P&gt;                       statusWord = 0x0600; //printf("Fl");  // modbus listen socket abort error&lt;/P&gt;&lt;P&gt;                       continue;&lt;/P&gt;&lt;P&gt;                }&lt;/P&gt;&lt;P&gt;                else&lt;/P&gt;&lt;P&gt;                {&lt;/P&gt;&lt;P&gt;                       printf("add: 0x%X\n %d",remote_addr.sin_addr,remote_addr.sin_port);&lt;/P&gt;&lt;P&gt;                       /////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;                       ///Grab child connected socket and pass no new task.&lt;/P&gt;&lt;P&gt;                    if (RTCS_detachsock(child_sock) == RTCS_OK)&lt;/P&gt;&lt;P&gt;                    {&lt;/P&gt;&lt;P&gt;                       printf("server child task.\n");&lt;/P&gt;&lt;P&gt;                            result = &lt;U&gt;task&lt;/U&gt;create(0, ModBus_C_TASK, child_sock);&lt;/P&gt;&lt;P&gt;                        if (result == MQX_NULL_TASK_ID)&lt;/P&gt;&lt;P&gt;                        {&lt;/P&gt;&lt;P&gt;                               shutdown(child_sock, FLAG_CLOSE_TX);&lt;/P&gt;&lt;P&gt;                           printf("\nCould not create server child task.\n\r");&lt;/P&gt;&lt;P&gt;                        }&lt;/P&gt;&lt;P&gt;                    }&lt;/P&gt;&lt;P&gt;                    else&lt;/P&gt;&lt;P&gt;                    {&lt;/P&gt;&lt;P&gt;                       printf("\nCould not create server child task.\n");&lt;/P&gt;&lt;P&gt;                    }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                       &lt;U&gt;time&lt;/U&gt;delay(1000);&lt;/P&gt;&lt;P&gt;                       printf("Client dispatched...\n\r");&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;                ///Check linkActive flag&lt;/P&gt;&lt;P&gt;              if(linkActive == false)&lt;/P&gt;&lt;P&gt;              {&lt;/P&gt;&lt;P&gt;                     shutdown(listensock_one, FLAG_ABORT_CONNECTION);//FLAG_CLOSE_TX);&lt;/P&gt;&lt;P&gt;                     statusWord = 0x0900;   //printf("Rv");  // modbus Restart modbus socket&lt;/P&gt;&lt;P&gt;                     return;&lt;/P&gt;&lt;P&gt;              }&lt;/P&gt;&lt;P&gt;         }&lt;/P&gt;&lt;P&gt;         while( child_sock != RTCS_SOCKET_ERROR );&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2014 17:57:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215992#M5539</guid>
      <dc:creator>davidsa</dc:creator>
      <dc:date>2014-12-12T17:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215993#M5540</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;What you are describing is the implementation as designed for this code you posted. You can open as many connections as you want form the same IP address. This code is allowing it. The only thing that distinguish each connections are the sockets. If you one new sockets form one IP address to another then you will open as much as you allow. Just imagine that you want to have two FTP or SSH connections from the same computer to another linux computer. FTP and/or SSH server will allow it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could prevent to create double connections, but you need to add the logic and code to track which IP addresses had already created a success connection. This should be implemented in the server side, the code you added. Just after the accept happened.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you to clarify how the implementation should be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Garabo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Dec 2014 03:18:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215993#M5540</guid>
      <dc:creator>Luis_Garabo</dc:creator>
      <dc:date>2014-12-13T03:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215994#M5541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks that actually make since. So the only viable solution is the let it connect compare the IP's&lt;/P&gt;&lt;P&gt;and if already connected then disconnect the user?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2014 14:09:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215994#M5541</guid>
      <dc:creator>davidsa</dc:creator>
      <dc:date>2014-12-15T14:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215995#M5542</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;Yes, you can either disconnect the current connected socket and then accept the new connection from the same IP address or you can reject the new connection if you confirm that the current connection is still alive and giving information back and forward.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Garabo&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>Mon, 15 Dec 2014 14:50:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215995#M5542</guid>
      <dc:creator>Luis_Garabo</dc:creator>
      <dc:date>2014-12-15T14:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215996#M5543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I delete the child_sock I do not want the child_sock, which is running on another task stops working.&lt;/P&gt;&lt;P&gt;Same IP address. And yes the other socket is running and exchanging data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shutdown(child_sock, FLAG_ABORT_CONNECTION);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2014 21:11:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215996#M5543</guid>
      <dc:creator>davidsa</dc:creator>
      <dc:date>2014-12-15T21:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215997#M5544</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;If you delete the code that creates the child then you will be able to handle only one client at the time. Again, it will depend a lot on the kind of implementation you want. This code is daemon kind implementation.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Garabo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2014 21:35:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215997#M5544</guid>
      <dc:creator>Luis_Garabo</dc:creator>
      <dc:date>2014-12-15T21:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215998#M5545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks I do understand what you are saying. Let me try to rephrase the question.&lt;/P&gt;&lt;P&gt;I get one connection on IP 172.22.1.5 port 0xc3d3 and I pass it to a task to run&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A second connection on IP 172.22.1.5 port 0xc3d4 and this socket I shutdown since it is from the same IP&lt;/P&gt;&lt;P&gt;address. When I close port 0xc3d4 it also closes the first port 0xc3d3 on a completely different task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the connection are from different ports why  are both connections closing and is there a method to&lt;/P&gt;&lt;P&gt;avoid this situation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 15:44:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215998#M5545</guid>
      <dc:creator>davidsa</dc:creator>
      <dc:date>2014-12-16T15:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215999#M5546</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;The port is the one used to stablish the socket connection. You can have many channels to you IP address, those are the ports. For instance, FTP is located in the port 22. If you are receiving another connection to the port 0xC3D4 then this should be rejected by TCPIP since you don't have a socket opened in this port.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are closing a socket you have to make sure is the one you are deattaching and passing to the client task. Or, the accept will return you a new socket, that is the one you need to shutdown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Garabo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 15:51:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/215999#M5546</guid>
      <dc:creator>Luis_Garabo</dc:creator>
      <dc:date>2014-12-16T15:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Embedded server</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/216000#M5547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help and telling me what is the obvious. I do understand the ports and&lt;/P&gt;&lt;P&gt;how all the socket connections work. I am also deleting the correct port.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help I will try to resolve this trying another method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 16:00:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Embedded-server/m-p/216000#M5547</guid>
      <dc:creator>davidsa</dc:creator>
      <dc:date>2014-12-16T16:00:03Z</dc:date>
    </item>
  </channel>
</rss>

