static int WebSocket_Get_ServerIp(char *p_Url, char *p_Ip)
{
assert(p_Url);
assert(p_Ip);
struct hostent *objHostInfo;
objHostInfo = gethostbyname(p_Url);
if(objHostInfo == NULL)
{
printf("Get Ip By Host Failed !!! \n");
return SN_ERROR;
}
sprintf(p_Ip,"%s", inet_ntoa(*((struct in_addr *)objHostInfo->h_addr)));
printf("==========HostName :%s , IP Address :%s\n",objHostInfo->h_name, p_Ip);
return SN_SUCCESS;
}
在此记录留着以后自己用