getaddrinfo failed gethostbyname函數(shù)已經(jīng)過時,怎么由getaddrinfo替換?
gethostbyname函數(shù)已經(jīng)過時,怎么由getaddrinfo替換?在使用gethostbyname之前非常簡單,類似于這樣:structhost*remotehoststructinuuadd
gethostbyname函數(shù)已經(jīng)過時,怎么由getaddrinfo替換?
在使用gethostbyname之前非常簡單,類似于這樣:
structhost*remotehost
structinuuaddraddr
if((remotehost=gethostbyname(hostname))==NULL){
xxxx
}
else{
if(remotehost->huaddrtype==AFuinet)
{
while(remotehost->huaddrulist[i]!=0){
addr.suaddr=*(uulong*)remoteHost->huaddrulist[i
]printf(“tIPAddress35;%d:%sn”,i,inetuntoa(addr))
Error: getaddrinfo ENOTFOUND?
錯誤:getaddrinfo enotfound錯誤是由于系統(tǒng)引起的,解決步驟如下:1配置.js配置文件,