 |
getnameinfo ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
Provides protocol-independent name resolution from an address to an ANSI host name and from a port number to the ANSI service name. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
int WSAAPI getnameinfo(
__in const struct sockaddr FAR *sa,
__in socklen_t salen,
__out char FAR *host,
__in DWORD hostlen,
__out char FAR *serv,
__in DWORD servlen,
__in int flags
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER getnameinfo IN ws2_32;
STRING @sockaddr,;
INTEGER salen,;
STRING @host,;
LONG hostlen,;
STRING @serv,;
LONG servlen,;
INTEGER procFlags
|
 |
 |
 |
| Parameters: |
 |
sa [in]
A pointer to a socket address structure that contains the address and port number of the socket. For IPv4, the sa parameter points to a sockaddr_in structure. For IPv6, the sa parameter points to a sockaddr_in6 structure.
salen [in]
The length, in bytes, of the structure pointed to by the sa parameter.
host [out]
A pointer to an ANSI string used to hold the host name.
hostlen [in]
The length, in bytes, of the buffer pointed to by the host parameter.
serv [out]
A pointer to an ANSI string to hold the service name.
servlen [in]
The length, in bytes, of the buffer pointed to by the serv parameter.
flags [in]
A value used to customize processing of the getnameinfo function. |
 |
 |
| Return value: |
 |
| On success, getnameinfo returns zero. Any nonzero return value indicates failure and a specific error code can be retrieved by calling WSAGetLastError. |
 |
 |
| Usage: |
 |
nResult = getnameinfo( @cSocaddrIn, LEN(cSocaddrIn),;
@cHostName, NI_MAXHOST,;
@cServiceName, NI_MAXSERV,;
nFlags )
|
 |
 |
| My comment: |
 |
| The getnameinfo function deprecates the gethostbyaddr function. |
 |
 |
| Word Index links for the getnameinfo : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2010-10-14 11:44:40 | | Modified: | 2010-10-14 11:49:42 | Visited in last 7 days: 9 |