getaddrinfo returns always 11001 (host not found)

断了今生、忘了曾经 提交于 2019-12-23 22:30:10

问题


Although the searched FQDN appears in etc\hosts file.

Any idea? Thanks a lot!


回答1:


Since I don't have code, here's a guess:

getaddrinfo("http://www.example.com");

Doesn't work; getaddrinfo takes a hostname not a URL.




回答2:


Take a look at this hostname not translated into an IP address using Winsock

getaddrinfo may be giving you an IPv6 address, or perhaps the machine has more than one IP address and you're trying to connect to the wrong one.



来源:https://stackoverflow.com/questions/995532/getaddrinfo-returns-always-11001-host-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!