API Reference


Brew Release
Brew MP 1.0.2
This function retrieves IP addresses associated with the specified host name. Results are placed in the result structure and a callback notifies the caller of completion. An AEECallback record is used to specify and cancel callbacks.
The memory pres and pcb pointers must remain valid for the entire duration of the operation (that is, until the completion callback is called, or until the operation is canceled). Calling INETMGR_Release() does not automatically cancel the callback. Therefore, if it is to be called before this operation completes, the specified callback must be canceled first. The result structure does not need to be initialized before the operation; INETMGR_GetHostByName() assigns its values.
The AEECallback must be properly initialized. The text string at psz can be discarded after the call to INETMGR_GetHostByName().
The call to this function always succeeds in that it guarantees the callback is called. Any errors related to handling the request are delivered to the callback, so all error checking can be done there.
  • pINetMgr
    Pointer to the INetMgr Interface object.
  • pres
    Pointer to the result structure.
  • psz
    Domain name to be resolved, terminated by a colon (:),slash (/), or NULL (\0) character.
  • pcb
    Pointer to the callback.
    void INETMGR_GetHostByName
    INetMgr * pINetMgr,
    AEEDNSResult * pres,
    const char * psz,
    AEECallback * pcb

On completion: - pres->addrs[] contains the result IP addresses.
- pres->nResult contains either the number of addresses obtained (1...AEEDNSMAXADDRS),

or an error code if the host has no addresses
or if it encountered an error while requesting the information.

The following error code definitions are specific to INETMGR_GetHostByName():
AEE_NET_BADDOMAIN Host name is malformed; not a valid host name.
AEE_NET_UNKDOMAIN Unknown host, or one without IP addresses.
AEE_NET_ETIMEDOUT No response was seen within the maximum time limit.
EUNSUPPORTED DNS servers do not need to be configured on the device for it to work properly, otherwise EUNSUPPORTED is returned.
AEE_NET_GENERAL_FAILURE When there is an allocation failure.
AEE_NET_EOPNOTSUPP DNS Look up Not Supported.
Other error codes (such as Network error codes related to network connection failure, and so forth) are also possible. See ISOCKET_SendTo() for some more possible error codes.
  • Follow