When I call gethostbyname in a NDK application without networking, then I turn on wifi switch, and call gethostbyname with the same host again, and it still failed, h_errno = 2.
Why is this and how to avoid it.
When I call gethostbyname in a NDK application without networking, then I turn on wifi switch, and call gethostbyname with the same host again, and it still failed, h_errno = 2.
Why is this and how to avoid it.
Copyright © 2021 Jogjafile Inc.
As per the returned h_error value, it indicates "TRY_AGAIN". From gethostbyname() man page:
So, try again and see what happens.