Using Win32 functions in Visual FoxPro Image Gallery
Windows Sockets 2 (Winsock)
..msdn
accept
bind
closesocket
gethostbyaddr
gethostbyname
gethostname
getnameinfo
getprotobyname
getprotobynumber
getservbyname
getservbyport
getsockopt
htonl
htons
inet_addr
inet_ntoa
listen
ntohl
ntohs
recv
recvfrom
send
sendto
setsockopt
socket
WSACleanup
WSACloseEvent
WSAConnect
WSACreateEvent
WSAEnumProtocols
WSAEventSelect
WSAGetLastError
WSARecv
WSASend
WSAStartup
WSAWaitForMultipleEvents
ws_connect
ws_select
Code examples:
Winsock: resolving an address to a host name
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:
Winsock: resolving an address to a host name
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:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2010-10-14 11:44:40
Modified: 2010-10-14 11:49:42
Visited in last 7 days: 16
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2014 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.68), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (184.73.104.82)
1.7 min.Example: 'How to create non-blocking Winsock server'
Language: 'C++'
3 day(s)Function: 'SHGetFolderLocation'
 Function: 'GetDriveType'
Function group: 'File Management'
 Example: 'How to control Adobe Reader 9.0 (SDI mode) from VFP application'
 
Function group: 'Filled Shape'
Google
Advertise here!