struct HOSTENT FAR * gethostbyaddr
(
const char FAR * addr,
int len,
int type
);第一个参数是一个char*型的IP地址
第二个参数是strlen(这个IP地址)
第三个参数不知能取什么样的值,又分别代表什么意思(MSDN上没说)
如果拥有这个IP的主机在一个防火墙之后,这个函数是否还能正确返回该主机的信息?当这个IP地址不存在的侍候,该捕获什么样的Exception,即
try{
gethostbyip(ip,strlen(ip),?)
}
catch(什么Exception ex?)
{
..........
}
(
const char FAR * addr,
int len,
int type
);第一个参数是一个char*型的IP地址
第二个参数是strlen(这个IP地址)
第三个参数不知能取什么样的值,又分别代表什么意思(MSDN上没说)
如果拥有这个IP的主机在一个防火墙之后,这个函数是否还能正确返回该主机的信息?当这个IP地址不存在的侍候,该捕获什么样的Exception,即
try{
gethostbyip(ip,strlen(ip),?)
}
catch(什么Exception ex?)
{
..........
}
type
[in] Type of the address, such as the AF_INET address family type (defined as TCP, UDP, and other associated Internet protocols). Address family types and their corresponding values are defined in the winsock2.h header file.