When calling DNSGetHostByName, the request always fails with error 19 NDK_DNS_ENODNSREPLY. However, when debugging it turns out the socket cannot be opened.
As the network interface is working fine and other socket calls before the DNS request pass without any problems, I exclude a general problem in the network configuration. However, normally I am using
fdOpenSession(TaskSelf()) and fdCloseSession(TaskSelf()) before socket operations.
I have tried to do the same with the DNS request, but this does not work either:
char hn[64], b[512]; sprintf (hn, "cloud.coqon.de"); fdOpenSession(TaskSelf()); int status = DNSGetHostByName(hn, b, sizeof(b)); fdCloseSession(TaskSelf());
I did not have a .cfg file in my project, only .syscfg. So i added a blank cfg file with contents:
var Global = xdc.useModule ('ti.ndk.config.Global'); Global.autoOpenCloseFD = true;
This does not work either and when removing the fd.. functions from the other socket functions, they stop working as well. So the setting is apparently not being applied.
Is there a way to process DNS requests by manually opening and closing the fd or how can I get the autoOpenCloseFD=true working?
Thank you and regards
Peter