Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我在没有网络的NDK应用程序中调用gethostbyname时,我打开wifi开关,再次用同一主机调用gethostbyname,它仍然失败,h_errno = 2。
为什么会这样以及如何避免。
根据返回的 h_error 值,它表示“TRY_AGAIN”。从 gethostbyname() 手册页:
TRY_AGAIN A temporary error occurred on an authoritative name server.Try again later.
所以,再试一次,看看会发生什么。