nrfxlib API 2.7.99
Loading...
Searching...
No Matches

◆ nrf_getaddrinfo()

int nrf_getaddrinfo ( const char *restrict  nodename,
const char *restrict  servname,
const struct nrf_addrinfo *restrict  hints,
struct nrf_addrinfo **restrict  res 
)

#include <nrf_modem/include/nrf_socket.h>

Get address information.

See POSIX.1-2017 article for normative description.

Note
When using address family NRF_AF_UNSPEC the implementation attempts to resolve the IPv6 address first. If successful, the resolved address is returned. If not, the implementation attempts to resolve and return the IPv4 family address. This applies regardless of the PDN supporting IPv6 or not.

In addition, the function may return -1 and set the following errno:

  • [NRF_ESHUTDOWN] Modem was shut down.