<?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: OPT_CONNECT_TIMEOUT not working as expected?</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161219#M1249</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For some reason this forum wont let you edit the first post? weird...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, here is the consol output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RC:192.168.2.20:10000 (this is nothing on my network or subnet)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Socket configured&lt;/P&gt;&lt;P&gt;getsockopt OPT_RECEIEVE_NOWAIT = 1&lt;/P&gt;&lt;P&gt;getsockopt OPT_CONNECT_TIMEOUT = 3E8&lt;/P&gt;&lt;P&gt;Socket Bind complete&lt;/P&gt;&lt;P&gt;ERROR CODE &amp;gt; 147 (2 minutes or so later, this is the error code on connect())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have also notice this commend:&lt;/P&gt;&lt;P&gt;"Values ≥ 180,000 (RTCS maintains the connection for this number of milliseconds)."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how do I stop RTCS maintaining the connection? I assume this is the problem...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Nov 2012 03:10:58 GMT</pubDate>
    <dc:creator>CarlFST60L</dc:creator>
    <dc:date>2012-11-01T03:10:58Z</dc:date>
    <item>
      <title>OPT_CONNECT_TIMEOUT not working as expected?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161218#M1248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have played with this for a little while and been unable to resolve my issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly, I am running MQX3.7 on the 52259evb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My software is all fine and works as well as it can with the exception of OPT_CONNECT_TIMEOUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All I want to happen is connect() to return after 1 second if it fails to connect, but its always a couple of minutes which is way to long for our application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I simply have the MQX RTCS connecting to my linux box or cygwin terminal. It Accepts connections using netcat listen on port 23 (nc -l 23) which works exactly as expected every time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have another UDP socket which is connected using similar methods and 100% works. this UDP issues commands such as RC:192.168.1.10:23 (Remote Connect to IP on port). This all works 100%. If my linux box is not listening, or, I try to connect to an unknown network like RC:199.199.199.199:10000 it just stays in 'connect()' for a couple of minutes regardless of what value I put in OPT_CONNECT_TIMEOUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is my understanding of this wrong? Is this timer related to TCP packet time-outs? or some other timeout??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a code snippet: (note there is some other code and messy debug info as I am just testing, the values of RC are global so they are not shown in the decleration)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//------------------------------------------------------&lt;/P&gt;&lt;P&gt;//This thread is called after another thread already has a UDP session attached and connected to my server which is where the RC: command comes from&lt;/P&gt;&lt;P&gt;void ETHRC_Task(uint_32)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; sockaddr_in remote_sin; &lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; remote_len = sizeof(remote_sin);&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32 error;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32 i = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sockaddr_in local_sin; //Local address&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32 sock = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; int option = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; local_sin.sin_family&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = AF_INET;&lt;/P&gt;&lt;P&gt;&amp;nbsp; local_sin.sin_port&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = ETHRC_HOST_PORT; //Get the port&lt;/P&gt;&lt;P&gt;&amp;nbsp; local_sin.sin_addr.s_addr = INADDR_ANY;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Create a datagram socket: &lt;/P&gt;&lt;P&gt;&amp;nbsp; sock = socket(PF_INET, SOCK_STREAM, 0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (sock == RTCS_SOCKET_ERROR)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; Write_Log((uchar*)STR_ERROR_CODE, ETH_SOCKET_CREATION_FAILED, 3, 0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; (uint_32)shutdown(sock, SOCKET_SHUT_PARAM);&lt;/P&gt;&lt;P&gt;&amp;nbsp; _task_abort(MQX_NULL_TASK_ID);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("\nSocket configured\n");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i = sizeof(int);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; option = TRUE; //Dont wait for data to come, just poll it&lt;/P&gt;&lt;P&gt;&amp;nbsp; error = setsockopt(sock, SOL_TCP, OPT_RECEIVE_NOWAIT, &amp;amp;option, sizeof(option));&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(error != RTCS_OK) printf("Cannot set OPT_RECEIVE_NOWAIT %x\n", error);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; error = getsockopt(sock, SOL_TCP, OPT_RECEIVE_NOWAIT, &amp;amp;option, (uint_32_ptr *)&amp;amp;i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(error != RTCS_OK) printf("getsockopt(OPT_RECEIEVE_NOWAIT) failed with error %x\n", error);&lt;/P&gt;&lt;P&gt;&amp;nbsp; else printf("getsockopt OPT_RECEIEVE_NOWAIT = %X\n", option);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; option = 1000; //5 second timeout on connections&lt;/P&gt;&lt;P&gt;&amp;nbsp; error = setsockopt(sock, SOL_TCP, OPT_CONNECT_TIMEOUT, &amp;amp;option, sizeof(option));&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(error != RTCS_OK) printf("Cannot set OPT_CONNECT_TIMEOUT %x\n", error);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; error = getsockopt(sock, SOL_TCP, OPT_CONNECT_TIMEOUT, &amp;amp;option, (uint_32_ptr *)&amp;amp;i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(error != RTCS_OK) printf("getsockopt(OPT_CONNECT_TIMEOUT) failed with error %x\n", error);&lt;/P&gt;&lt;P&gt;&amp;nbsp; else printf("getsockopt OPT_CONNECT_TIMEOUT = %X\n", option);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Bind the datagram socket to the UDP port: &lt;/P&gt;&lt;P&gt;&amp;nbsp; error = bind(sock, &amp;amp;local_sin, sizeof(local_sin));&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (error != RTCS_OK) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; // ***FIX, log and restart task or manage proerly&lt;/P&gt;&lt;P&gt;&amp;nbsp; //if(LiveLogDisplayLevel &amp;gt;= 4) printf("Bind fail\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp; Write_Log((uchar*)STR_ERROR_CODE, ETH_BIND_FAILED, 3, 0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; (uint_32)shutdown(sock, SOCKET_SHUT_PARAM);&lt;/P&gt;&lt;P&gt;&amp;nbsp; _task_abort(MQX_NULL_TASK_ID);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("Socket Bind complete\n");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; memset((char *) &amp;amp;remote_sin, 0, sizeof(sockaddr_in));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; remote_sin.sin_family = AF_INET;&lt;/P&gt;&lt;P&gt;&amp;nbsp; remote_sin.sin_port = ETHRC_HOST_PORT; //Port (same as local outgoing port)&lt;/P&gt;&lt;P&gt;&amp;nbsp; remote_sin.sin_addr.s_addr = ETHRC_HOST_IP; //Server address&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; error = connect(sock, &amp;amp;remote_sin, sizeof(sockaddr_in));&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (error != RTCS_OK)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; Write_Log((uchar*)STR_ERROR_CODE, ETH_REBIND_FAIL1, 3, 0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; (uint_32)shutdown(sock, SOCKET_SHUT_PARAM);&lt;/P&gt;&lt;P&gt;&amp;nbsp; _task_abort(MQX_NULL_TASK_ID);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("Socket connected\n");&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;//------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 03:03:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161218#M1248</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2012-11-01T03:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: OPT_CONNECT_TIMEOUT not working as expected?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161219#M1249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For some reason this forum wont let you edit the first post? weird...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, here is the consol output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RC:192.168.2.20:10000 (this is nothing on my network or subnet)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Socket configured&lt;/P&gt;&lt;P&gt;getsockopt OPT_RECEIEVE_NOWAIT = 1&lt;/P&gt;&lt;P&gt;getsockopt OPT_CONNECT_TIMEOUT = 3E8&lt;/P&gt;&lt;P&gt;Socket Bind complete&lt;/P&gt;&lt;P&gt;ERROR CODE &amp;gt; 147 (2 minutes or so later, this is the error code on connect())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have also notice this commend:&lt;/P&gt;&lt;P&gt;"Values ≥ 180,000 (RTCS maintains the connection for this number of milliseconds)."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how do I stop RTCS maintaining the connection? I assume this is the problem...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 03:10:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161219#M1249</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2012-11-01T03:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: OPT_CONNECT_TIMEOUT not working as expected?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161220#M1250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carl,&lt;/P&gt;&lt;P&gt;Did you resolve this?&lt;/P&gt;&lt;P&gt;If not just tossing out random thoughts.&lt;/P&gt;&lt;P&gt;- Do you have KEEPALIVE active?&lt;/P&gt;&lt;P&gt;- I see other timeouts in the tcp.c file (part of TCP_Process_open() ) and wonder if they might be causing trouble at the tcb level?.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style=": ; color: #3f7f5f; font-size: 2;"&gt;/* User timeout (R1) */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;if&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; ( coptions-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;utimeout&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &amp;gt;= 0 ) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;tcb-&amp;gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;sndto_1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; = coptions-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;utimeout&lt;/SPAN&gt;&lt;SPAN style="font-size: 2;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;else&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 2;"&gt; {&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;tcb-&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;sndto_1&lt;/SPAN&gt;&lt;SPAN style="font-size: 2;"&gt; = 0;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style=": ; color: #3f7f5f; font-size: 2;"&gt;/* &lt;SPAN style="text-decoration: underline;"&gt;Endif&lt;/SPAN&gt; */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;/* Connection timeout (R2) */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;if&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; ( coptions-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;timeout&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &amp;gt; 0 ) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;tcb-&amp;gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;sndto_2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; = coptions-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;timeout&lt;/SPAN&gt;&lt;SPAN style="font-size: 2;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10pt;"&gt;else&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 2;"&gt; {&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;tcb-&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;sndto_2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; = 2 * tcb-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;sndrtomax&lt;/SPAN&gt;&lt;SPAN style="font-size: 2;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style=": ; color: #3f7f5f; font-size: 2;"&gt;/* &lt;SPAN style="text-decoration: underline;"&gt;Endif&lt;/SPAN&gt; */&lt;/SPAN&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 align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;/* &lt;SPAN style="text-decoration: underline;"&gt;Keepalive&lt;/SPAN&gt; timeout */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 2;"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; ( coptions-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;keepalive&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="font-size: 10pt;"&gt; &amp;gt; 0 ) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;tcb-&amp;gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;keepaliveto&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; = coptions-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;keepalive&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="font-size: 10pt;"&gt; * 60000L;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;}&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 2;"&gt;else&lt;/STRONG&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="font-size: 10pt;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;tcb-&amp;gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;keepaliveto&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="font-size: 10pt;"&gt; = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;}&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;/* &lt;SPAN style="text-decoration: underline;"&gt;Endif&lt;/SPAN&gt; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The tcp.h has:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="color: #005032; font-size: 10pt;"&gt;int_32&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;utimeout&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;/* User timeout (&lt;SPAN style="text-decoration: underline;"&gt;msec&lt;/SPAN&gt;) - TCP R1 period */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="color: #005032; font-size: 10pt;"&gt;int_32&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;timeout&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;/* Connection timeout (&lt;SPAN style="text-decoration: underline;"&gt;msec&lt;/SPAN&gt;) - TCP R2 period (use 0 to default) */&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt; &lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;Comments in tcp.c:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;/* Soft timeout (R1) must occur *before* hard timeout (R2) (see RFC1122&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;** section 4.2.3.5 for more details on these timeouts) */&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&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;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;The code here adjust the R1 to meet the above requirement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;David&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 20:25:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161220#M1250</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2012-11-08T20:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: OPT_CONNECT_TIMEOUT not working as expected?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161221#M1251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carl, were you able to resolve this so that it times-out if it doesn't connect in 1s?&amp;nbsp; How was it done?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Oct 2013 01:58:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161221#M1251</guid>
      <dc:creator>ARQuattr</dc:creator>
      <dc:date>2013-10-06T01:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: OPT_CONNECT_TIMEOUT not working as expected?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161222#M1252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;The code here adjust the R1 to meet the above requirement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;how can i modify the value of R1???&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 02:41:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161222#M1252</guid>
      <dc:creator>everkimage</dc:creator>
      <dc:date>2013-12-18T02:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: OPT_CONNECT_TIMEOUT not working as expected?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161223#M1253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;R1 corresponds with stream socket option OPT_SEND_TIMEOUT. You can use setsockopt() to modify this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 08:16:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161223#M1253</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-12-18T08:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: OPT_CONNECT_TIMEOUT not working as expected?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161224#M1254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;it's still not work&lt;/STRONG&gt;.and this is my code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i = 1;&lt;/P&gt;&lt;P&gt;i = setsockopt( sock, SOL_TCP, OPT_KEEPALIVE, &amp;amp;i, sizeof( i ) );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;i = TCP_CONNECT_TIMEOUT / 2;&lt;/P&gt;&lt;P&gt;i = setsockopt( sock, SOL_TCP, OPT_SEND_TIMEOUT, &amp;amp;i, sizeof( i ) );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;i = TCP_CONNECT_TIMEOUT;&lt;/P&gt;&lt;P&gt;i = setsockopt( sock, SOL_TCP, OPT_CONNECT_TIMEOUT, &amp;amp;i, sizeof( i ) );&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Dec 2013 03:58:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161224#M1254</guid>
      <dc:creator>everkimage</dc:creator>
      <dc:date>2013-12-23T03:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: OPT_CONNECT_TIMEOUT not working as expected?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161225#M1255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try to change the value of DEFAULT_CONNECT_TIMEOUT,and rebuild the all projects,but it still does not work!&lt;/P&gt;&lt;P&gt;when i shutdown the server program,connect() returns in several seconds.&lt;/P&gt;&lt;P&gt;but when i disconnect the cable,it always wait for a long time.&lt;/P&gt;&lt;P&gt;God,help me!:smileycry:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Dec 2013 01:53:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161225#M1255</guid>
      <dc:creator>everkimage</dc:creator>
      <dc:date>2013-12-25T01:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: OPT_CONNECT_TIMEOUT not working as expected?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161226#M1256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;TCP_SENDTIMEOUT_MIN ok.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Dec 2013 03:22:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/OPT-CONNECT-TIMEOUT-not-working-as-expected/m-p/161226#M1256</guid>
      <dc:creator>everkimage</dc:creator>
      <dc:date>2013-12-25T03:22:44Z</dc:date>
    </item>
  </channel>
</rss>

