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 dot-decimal notation. The string must be NULL-terminated.
in servName Specifies a pointer to a service name string or to a string that represents the port number in 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

Returns 0 if successful.

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