Jul 27, 2013
10:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 27, 2013
10:58 AM
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)));
Labels
- Labels:
-
SPI
- Tags:
- %srn
- %u.%u.%u.%urn
- &app_ip_address
- &ip_address
- 15000
- 810404
- address
- app_server
- application
- call
- called
- cometa
- define
- lookup
- resolving
- result
- return
- returning
- returns
- sequence
- server
- server.rn
- serverrn
- uint8_tget_ipv4_addressapp_ip_address
- uint8_tget_ipv4_addressip_address
- wiced_hostname_lookup
- wiced_hostname_lookupapp_server
- wiced_hostname_lookupservice.cometa.io
- wiced_success
- wprint_app_info
- wprint_app_infocometa
- wprint_app_infoerror
- wprint_app_inforesolving
- wrong
- www.cloudfridge.io
3 Replies
Apr 04, 2014
02:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 04, 2014
02:25 PM
It is an issue in 2.4. In general I find wiced_hostname_lookup() very unreliable.
Jun 27, 2014
01:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 27, 2014
01:24 PM
Some more comments:
Part of this may be because the lookup() function sends a UDP request to all the registered DNS servers, and then waits for the remaining time (derived from the timeout passed to lookup()), for a reply. So, there is actually no retries happening.
Jul 03, 2014
12:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 03, 2014
12:52 PM
This explains the behavior I am seeing. It may be worthwhile documenting.
In general, I cannot rely on the lookup() function. I wonder if you can provide any other insights.