<?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: Can i use FTP and TCP Socket in parallel? in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Can-i-use-FTP-and-TCP-Socket-in-parallel/m-p/150601#M420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AAAAH !! &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after some deep debuging into the mqx i found the problem .. &lt;SPAN class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;&lt;LI-EMOJI id="lia_grinning-face-with-big-eyes" title=":grinning_face_with_big_eyes:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there was no free space in the socket partition .. and then i found the socket partition initialisation ..&lt;/P&gt;&lt;P&gt;and then i see this variable &amp;lt;_RTCS_socket_part_init&amp;gt; ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set this variable before you create the RTCS and you can get more than 3 sockets .. &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;_RTCS_socket_part_init=10;error=RTCS_create();&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 08:53:19 GMT</pubDate>
    <dc:creator>monXii</dc:creator>
    <dc:date>2020-10-29T08:53:19Z</dc:date>
    <item>
      <title>Can i use FTP and TCP Socket in parallel?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Can-i-use-FTP-and-TCP-Socket-in-parallel/m-p/150600#M419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am running a FTP Server on my K60 board .. with MQX3.8 ..&lt;/P&gt;&lt;P&gt;All is fine!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then in another project i used a TCP Socket for some communication ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i want to merge this 2 projects .. but both together don't work..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the TCP socket is listening the FTP don't work correctly.. i can connect but not more .. "LIST" hangs up ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now i removed the RTCS_selectall();&lt;/P&gt;&lt;P&gt;and the ftp is running correct, but my socket does not connect ..&lt;/P&gt;&lt;P&gt;here is my socket listen task ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i try to connect via telnet comes the error message "connection refused" ..&lt;/P&gt;&lt;P&gt;accept return every time RTC_SOCKET_ERROR ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void server_task (uint_32 initial_data) { sockaddr_in     laddr; uint_32      sock, listensock; int_32      error; uint_16      remote_addr_len; sockaddr_in     remote_addr = {0}; uint_32      value; boolean      connected=FALSE; boolean      opt_bool_value; _time_delay(100); #if (WITH_SOCKET_SERVER_TASK_DEBUG==1) printf("\nstart server_task !\n");#endif  laddr.sin_family      = AF_INET; laddr.sin_port        = SOCKET_SERVER_PORT; laddr.sin_addr.s_addr = INADDR_ANY; listensock = socket(PF_INET, SOCK_STREAM, 0); printf("STATE: %x\n", ((SOCKET_STRUCT_PTR)listensock)-&amp;gt;STATE); if (listensock == RTCS_SOCKET_ERROR) {  printf("can't create socket ..\n");  error = RTCSERR_OUT_OF_SOCKETS; } value = 256; error=setsockopt(listensock, SOL_TCP,OPT_TBSIZE,&amp;amp;value,sizeof(value)); if (error) { printf("something failed..1!\n"); } error=setsockopt(listensock, SOL_TCP,OPT_RBSIZE,&amp;amp;value,sizeof(value)); if (error) { printf("something failed..2!\n"); }  opt_bool_value=TRUE; error=setsockopt(listensock, SOL_TCP,OPT_RECEIVE_NOWAIT,&amp;amp;opt_bool_value,sizeof(opt_bool_value)); if (error) { printf("something failed..3!\n"); } error = bind(listensock, &amp;amp;laddr, sizeof(laddr)); printf("STATE: %x\n", ((SOCKET_STRUCT_PTR)listensock)-&amp;gt;STATE);  if (!error) {  error = listen(listensock, 0); } else {  printf("something failed..4!\n"); }  sock=RTCS_SOCKET_ERROR; printf("socket init done!\n"); printf("STATE: %x\n", ((SOCKET_STRUCT_PTR)listensock)-&amp;gt;STATE); for (;;) {  connected=FALSE;  while (connected==FALSE) {   #if (WITH_SOCKET_SERVER_TASK_DEBUG==1)   printf("wait for connection..\n");   #endif      _time_delay(1000);      /*   //sock = RTCS_selectall(0);   sock=RTCS_selectset(&amp;amp;listensock, 1, 500);      if (sock == listensock) {    connected=TRUE;   } else {    #if (WITH_SOCKET_SERVER_TASK_DEBUG==1)||1    printf("no.. %x != %x\n", sock, listensock);    #endif    continue;   }   */   // Connection requested; accept it      remote_addr_len = sizeof(remote_addr);   printf("STATE: %x\n", ((SOCKET_STRUCT_PTR)listensock)-&amp;gt;STATE);   printf("try to accept socket.. sock: %x, listensock: %x\n", sock, listensock);   sock = accept(listensock, &amp;amp;remote_addr, &amp;amp;remote_addr_len);   printf("accepted socket! sock: %x, listensock: %x\n", sock, listensock);   connected=TRUE;   if (sock==RTCS_SOCKET_ERROR) {    shutdown((uint_32)listensock, FTPDCFG_SHUTDOWN_OPTION);    connected=FALSE;   } else {    #if (WITH_SOCKET_SERVER_TASK_DEBUG==1)    printf("remote addr: %d.%d.%d.%d : %d connected\n",      (remote_addr.sin_addr.s_addr &amp;gt;&amp;gt; 24) &amp;amp; 0xFF,      (remote_addr.sin_addr.s_addr &amp;gt;&amp;gt; 16) &amp;amp; 0xFF,      (remote_addr.sin_addr.s_addr &amp;gt;&amp;gt; 8) &amp;amp; 0xFF,      remote_addr.sin_addr.s_addr &amp;amp; 0xFF,      remote_addr.sin_port);    #endif   }  }  while (1) {   // do something with connection ..  }    shutdown(sock, FLAG_CLOSE_TX); }  printf("fatal error!\n");}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:53:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Can-i-use-FTP-and-TCP-Socket-in-parallel/m-p/150600#M419</guid>
      <dc:creator>monXii</dc:creator>
      <dc:date>2020-10-29T08:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can i use FTP and TCP Socket in parallel?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Can-i-use-FTP-and-TCP-Socket-in-parallel/m-p/150601#M420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AAAAH !! &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after some deep debuging into the mqx i found the problem .. &lt;SPAN class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;&lt;LI-EMOJI id="lia_grinning-face-with-big-eyes" title=":grinning_face_with_big_eyes:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there was no free space in the socket partition .. and then i found the socket partition initialisation ..&lt;/P&gt;&lt;P&gt;and then i see this variable &amp;lt;_RTCS_socket_part_init&amp;gt; ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set this variable before you create the RTCS and you can get more than 3 sockets .. &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;_RTCS_socket_part_init=10;error=RTCS_create();&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:53:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Can-i-use-FTP-and-TCP-Socket-in-parallel/m-p/150601#M420</guid>
      <dc:creator>monXii</dc:creator>
      <dc:date>2020-10-29T08:53:19Z</dc:date>
    </item>
  </channel>
</rss>

