Форум: "Потрепаться";
Текущий архив: 2002.09.16;
Скачать: [xml.tar.bz2];
ВнизОписание функции gethostbyaddr Найти похожие ветки
← →
VictorT (2002-08-21 13:05) [0]У меня MSDN не полный, кто-нить может кинуть сабж? Мне вообще-то для Visual C надо, но думаю и другое подойдёт.
← →
MBo (2002-08-21 13:31) [1]а msdn.microsoft.com?
The Windows Sockets gethostbyaddr function gets host information corresponding to an address.
struct hostent FAR * gethostbyaddr (
const char FAR * addr,
int len,
int type
);
Parameters
addr
[in] A pointer to an address in network byte order.
len
[in] The length of the address.
type
[in] The type of the address.
Remarks
gethostbyaddr returns a pointer to the following hostent structure which contains the name(s) and address which correspond to the given address. All strings are null terminated.
Return Values
If no error occurs, gethostbyaddr returns a pointer to the hostent structure described above. Otherwise, it returns a NULL pointer and a specific error number can be retrieved by calling WSAGetLastError.
Error Codes
WSANOTINITIALISED A successful WSAStartup must occur before using this function.
WSAENETDOWN The network subsystem has failed.
WSAHOST_NOT_FOUND Authoritative Answer Host not found.
WSATRY_AGAIN Non-Authoritative Host not found, or server failed.
WSANO_RECOVERY Nonrecoverable error occurred.
WSANO_DATA Valid name, no data record of requested type.
WSAEINPROGRESS A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function.
WSAEAFNOSUPPORT The type specified is not supported by the Windows Sockets implementation.
WSAEFAULT The addr argument is not a valid part of the user address space, or the len argument is too small.
WSAEINTR The (blocking) call was canceled through WSACancelBlockingCall.
← →
VictorT (2002-08-21 16:22) [2]Спасибочки, только мне бы ещё узнать, в каком *.h файле она находится (в смысле, что в #include писать), и описание struct hostent FAR.
← →
MBo (2002-08-21 16:38) [3]А что с online msdn? :)
Import library ws2_32.lib
header winsock2.h
hostent
his structure is allocated by Windows Sockets. An application should never attempt to modify this structure or to free any of its components. Furthermore, only one copy of this structure is allocated per thread, and so the application should copy any information that it needs before issuing any other Windows Sockets API calls.
struct hostent {
char FAR * h_name;
char FAR * FAR * h_aliases;
short h_addrtype;
short h_length;
char FAR * FAR * h_addr_list;
};
Members
h_name
Official name of the host (PC).If using the DNS or similar resolution system, it is the Fully Qualified Domain Name (FQDN) that caused the server to return a reply. If using a local "hosts" file, it is the first entry after the IP address.
h_aliases
A NULL-terminated array of alternate names.
h_addrtype
The type of address being returned.
h_length
The length, in bytes, of each address.
h_addr_list
A NULL-terminated list of addresses for the host. Addresses are returned in network byte order.The macro h_addr is defined to be h_addr_list[0] for compatibility with older software.
← →
VictorT (2002-08-21 16:41) [4]
> MBo © (21.08.02 16:38)
Спасибо огромное, что не поленился посмотреть.
А насчёт online msdn, так я там на 404 нарываюсь именно там, где надо (по закону подлости).
← →
VictorT (2002-08-21 16:45) [5]Извиняюсь, опять потревожу, с параметром int type неясно, какие у него значения могут быть?
← →
MBo (2002-08-21 16:50) [6]не поясняется
Страницы: 1 вся ветка
Форум: "Потрепаться";
Текущий архив: 2002.09.16;
Скачать: [xml.tar.bz2];
Память: 0.46 MB
Время: 0.007 c