nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ util_resolve_host()

int util_resolve_host ( int  cid,
const char *  host,
uint16_t  port,
int  family,
struct sockaddr *  sa 
)

Resolve remote host by host name or IP address.

This function wraps up getaddrinfo() to return first resolved address.

Parameters
[in]cidPDP Context ID as defined in "+CGDCONT" command (0~10).
[in]hostName or IP address of remote host.
[in]portService port of remote host.
[in]familyDesired address family for the returned address.
[out]saThe returned address.
Return values
0If the operation was successful. Otherwise, an errno code or a dns_resolve_status enum value (defined in zephyr/net/dns_resolve.h).