Function SocketGetHostByName() Professional
Retrieves host information from a host name.
Syntax
SocketGetHostByName( <cHostName>, ;
[@<nError>] ) --> aHostInfo|NIL
Parameters
<cHostName>
The name of a host is specified as a character string.
<nError>
If this parameter is passed by reference to the function, it gets assigned a numeric error code when the function fails. #define constants beginning with WSAE are available in the file SOCKET.CH to identify an error condition.
Return
The function returns an array containing host information, or NIL on failure. The following #define constants are available in the file SOCKET.CH to access the individual elements of the host array:
Constants for the host array
Constant | Description |
---|---|
HOSTINFO_CNAME | Character string containing the host name |
HOSTINFO_ALIAS | One-dimensional array holding the alias names of the host. If no alias names exist, the array is empty. |
HOSTINFO_NTYPE | Numeric value indicating address family. (always AF_INET for Windows sockets) |
HOSTINFO_NLEN | Number of bytes required to encode the numeric IP address. |
HOSTINFO_ADDR | One-dimensional array holding the numeric IP addresses of the host in network byte order. |
Feedback
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.