Embedded TCP/IP stack: fnet_dns_init

FNET

fnet_dns_desc_t fnet_dns_init ( struct fnet_dns_params params)

Initializes the DNS client service and starts the host name resolving.

Parameters
paramsInitialization parameters.
Returns
This function returns:
  • DNS client descriptor if no error occurs.
  • FNET_NULL if an error occurs.
See also
fnet_dns_params, fnet_dns_callback_resolved_t, fnet_dns_release()

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.


© 2005-2018 by Andrey Butok. http://fnet.sourceforge.net