Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Потрепаться";
Текущий архив: 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
1-50822
maxim2
2002-09-04 06:07
2002.09.16
И еще вопросик как узнать на какой строке находится курсор в Rich


1-50691
NiConZ
2002-09-05 10:31
2002.09.16
->IDE->Code templates ?


14-50929
Jo
2002-08-21 09:03
2002.09.16
Подскажите где можно взять документацию на MemProof?


14-50938
kalenih
2002-08-21 10:47
2002.09.16
Сибирь


1-50783
SergeyKnyazev
2002-09-03 12:35
2002.09.16
Нужно вывести рисунок на принтер





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский