nn::socket::GetAddrInfo Function

Syntax

s32 GetAddrInfo(
     const char8 * nodeName,
     const char8 * servName,
     const AddrInfo * hints,
     AddrInfo ** res
);

Arguments

Name Description
in nodeName Specifies a pointer to a host name string or to a string that represents the IPv4 host address in dotted-decimal notation. The string must be NULL-terminated.
in servName Specifies a pointer to a service name character string or to a character string that represents the port number in a numeric form. The string must be NULL-terminated.
in hints Specifies a pointer to the AddrInfo structure that sets search options.
in res Specifies a pointer to a variable that itself has a pointer to an AddrInfo structure with the search results.

Return Values



Value Description
0 Process was successful.
EAI_FAIL Processing is impossible for one of the following reasons:
The socket type given by hints is not supported.
The socket protocol given by hints is not supported.
nodeName cannot be interpreted as a character string in dot-decimal notation even though AI_NUMERICHOST is specified for hints.
servName cannot be interpreted as a character string in numeric notation even though AI_NUMERICSERV is specified for hints.
The length of host name specified for nodeName exceeds MAXDNAME.
The service name given by servName cannot be parsed as an existing service name.
EAI_MEMORY Cannot allocate the required amount of memory for processing.
EAI_NONAME Cannot find the host being searched for.

Description

This function searches for host information based on the host name and service name of the host.

Since this function might query the DNS server, it blocks until the search is complete. A new buffer with the search results is allocated from the work region specified by the Initialize function. Use the FreeAddrInfo function to free the search results.

See Also

FreeAddrInfo

Revision History

2010/06/14
Initial version.

CONFIDENTIAL