This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Ability to set custom timeout for getaddrinfo?

Hello,

When operating the Thingy91 in poor network connectivity environments, the call to getaddrinfo will sometimes block and eventually timeout returning a error code 60 (ETIMEDOUT).

Is there a way to set a specific/custom timeout for getaddrinfo?
EDIT: Based on Didrik Rokhaug's response in the following ticket, it looks like the answer is no. (https://devzone.nordicsemi.com/f/nordic-q-a/55840/getaddrinfo-in-can-block-indefinitely-after-lte-connect)

Do you know what the timeout for getaddrinfo is by default?
If there is no way to set a timeout for getaddrinfo, is there a workaround?

Thanks,
Cody

Parents
  • Hi again!

    getaddrinfo() in BSDLib returns ETIMEDOUT, if the DNS server can't be reached or isn't answering. I'm still waiting on information regarding the specific time it waits before returning the error so I will get back to you on that. 

    A workaround could be to not look up the address but have ut saved statically in the application.

    Best regards,

    Heidi

Reply
  • Hi again!

    getaddrinfo() in BSDLib returns ETIMEDOUT, if the DNS server can't be reached or isn't answering. I'm still waiting on information regarding the specific time it waits before returning the error so I will get back to you on that. 

    A workaround could be to not look up the address but have ut saved statically in the application.

    Best regards,

    Heidi

Children
Related