5 Replies Latest reply on May 28, 2013 2:18 PM by MaGr_2160016

    wiced_tcp_receive() stops receiving after idle for more than 10 secs

    MaGr_2160016

      [WICED-SDK-2.2.1]

       

       

      Any idea why wiced_tcp_receive() stops receiving after remaining idle for more than 10 seconds?

       

       

      I have the following simple loop:

       

       

      
      while (1) {
      
              result = wiced_tcp_receive(&cometa_socket, &rx_packet, WICED_NEVER_TIMEOUT);
      
              if( result != WICED_SUCCESS ) {
      
                  WPRINT_APP_INFO(("TCP packet reception failed
      
      "));
      
                  continue;
      
              }
      
              /* Get the contents of the received packet */
      
               wiced_packet_get_data(rx_packet, 0, (uint8_t**)&rx_data, &rx_data_length, &available_data_length);
      
      
               /* Null terminate the received string */
      
               rx_data[rx_data_length] = x0;
      
               WPRINT_APP_INFO(("Received:
      
      %s
      
      ", rx_data));
      
      
               wiced_packet_delete(rx_packet);
      
        }
      
      

       

       

      The other endpoint can send any number of messages to this loop but if there is a delay of more than 10 seconds between them, nothing is received and the loop hangs at wiced_tcp_receive().

       

       

      I have an equivalent loop on a linux box connected with the same endpoint that doesnt have this problem.

       

       

      Any suggestion would be appreciated.

       

       

      -Marco G.