Defined in:Looks up the IP address corresponding to a domain name.
DomainNameResolver *ResolveAddress(const char *name);
||The domain name of the server whose IP address should be resolved.|
ResolveAddressfunction causes an object of type
DomainNameResolverto be created and maintained by the Network Manager. Domain names are resolved asychronously, so the
ResolveAddressfunction always returns immediately. If the domain name resolution operation is successfully initiated, then the return value is a pointer to a
DomainNameResolverobject; otherwise, the return value is
After a successful call to
ResolveAddress, a completion callback should be installed for the returned object. This completion callback is invoked during the next call to
NetworkMgr::NetworkTaskafter the domain name resolution completes. The completion callback can extract the resolved IP address by calling the
DomainNameResolver::GetAddressfunction. After the completion callback is called, the
DomainNameResolverobject is automatically destroyed.
A domain name resolution can be canceled before its completion callback is invoked by calling the
ResolveAddressfunction should not be called before the Network Manager has been successfully initialized by the
NetworkMgr::Initializefunction or the