Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gethostbyname

Asynchronous DNS resolving function.

This function use DNS to resolve a domain name into the corresponding IP address. A call to this function will cause a DNS request to be sent and the response will be delivered to the DNS callback function registered using registerSocketCallback()

Functions

NMI_API sint8 gethostbyname (uint8 *pcHostName)
 

NMI_API sint8 gethostbyname ( uint8 pcHostName)
         Asynchronous DNS resolving function. This function uses DNS to resolve a domain name to the corresponding IP address.
         A call to this function will cause a DNS request to be sent and the response will be delivered to the DNS callback
         function registered using registerSocketCallback.
Parameters
[in]pcHostNameNULL terminated string containing the domain name for the remote host. Its size must not exceed HOSTNAME_MAX_SIZE.
See Also
registerSocketCallback
Warning
Successful completion of a call to gethostbyname() does not guarantee success of the DNS request, a negative return value indicates only locally-detected errors
Returns
Parameters
[in]pcHostNameNULL terminated string containing the domain name for the remote host. Its size must not exceed HOSTNAME_MAX_SIZE.
Warning
Successful completion of a call to gethostbyname() does not guarantee success of the DNS request, a negative return value indicates only locally-detected errors
See Also
registerSocketCallback
Returns

References HOSTNAME_MAX_SIZE, M2M_REQ_DATA_PKT, m2m_strlen(), NULL, SOCK_ERR_INVALID, SOCK_ERR_INVALID_ARG, SOCK_ERR_NO_ERROR, SOCKET_CMD_DNS_RESOLVE, and SOCKET_REQUEST.

Referenced by AppServerCb(), ConnectNetwork(), handle_start_connect(), http_client_send_request(), iot_tls_connect(), NMI_GrowlSendNotification(), and wifi_cb().