nn::socket::GetAddrInfo Function
s32 GetAddrInfo(
const char8 * nodeName,
const char8 * servName,
const AddrInfo * hints,
AddrInfo ** res
);
| 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. |
| Value | Description |
|---|---|
| 0 | Process was successful. |
| EAI_FAIL | Processing is impossible for one of the following reasons:hints is not supported.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.nodeName exceeds MAXDNAME.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. |
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.
CONFIDENTIAL