3 Replies Latest reply on Jul 3, 2014 12:52 PM by MaGr_2160016

    wiced_hostname_lookup() returning wrong IP address when called twice

    MaGr_2160016
      Every once in a while the second call to wiced_hostname_lookup() in sequence below returns the same IP address of the first call:

       

       

          WPRINT_APP_INFO(("Resolving IP address of Cometa server

       

      " ));

       

          wiced_hostname_lookup("service.cometa.io", &ip_address, 15000);

       

          WPRINT_APP_INFO(("Cometa is at %u.%u.%u.%u

       

      ", (uint8_t)(GET_IPV4_ADDRESS(ip_address) >> 24),

       

                                                        (uint8_t)(GET_IPV4_ADDRESS(ip_address) >> 16),

       

                                                        (uint8_t)(GET_IPV4_ADDRESS(ip_address) >> 8),

       

                                                        (uint8_t)(GET_IPV4_ADDRESS(ip_address) >> 0) ) );

       

       

          #define APP_SERVER "www.cloudfridge.io"

       

          WPRINT_APP_INFO( ( "Resolving IP address of Application server %s

       

      ", APP_SERVER));

       

          result = wiced_hostname_lookup(APP_SERVER, &app_ip_address, 15000);

       

      if (result != WICED_SUCCESS) {

       

             WPRINT_APP_INFO(("Error in DNS lookup for App server.

       

      "));

       

             return;

       

            }

       

          WPRINT_APP_INFO( ( "App server is at %u.%u.%u.%u

       

      ", (uint8_t)(GET_IPV4_ADDRESS(app_ip_address) >> 24),

       

                                                        (uint8_t)(GET_IPV4_ADDRESS(app_ip_address) >> 16),

       

                                                        (uint8_t)(GET_IPV4_ADDRESS(app_ip_address) >> 8),

       

                                                        (uint8_t)(GET_IPV4_ADDRESS(app_ip_address) >> 0)));