Embedded TCP/IP stack
4.7.0
|
fnet_dns_desc_t fnet_dns_init | ( | struct fnet_dns_params * | params | ) |
Initializes the DNS client service and starts the host name resolving.
params | Initialization parameters. |
FNET_NULL
if an error occurs.This function initializes the DNS client service and starts the host name resolving. It allocates all needed resources and registers the DNS service in the polling list.
After the initialization, the user application should call the main polling function fnet_service_poll() periodically to run the DNS service routine in the background.
The resolved IP-address will be passed to the fnet_dns_callback_resolved_t callback function, which is set in params
.
The DNS service is released automatically as soon as the resolving is finished or or a timeout is occurred. The timeout equals to FNET_CFG_DNS_RETRANSMISSION_TIMEOUT * FNET_CFG_DNS_RETRANSMISSION_MAX seconds.