tfDnsGetNextMailHost
Table of Contents >> Application Reference >> DNS Resolver
#include <trsocket.h> |
int tfDnsGetNextMailHost | ( |
const char * hostnameStr, | |
ttUserIpAddress lastIpAddress, | |
unsigned short lastPreference, | |
ttUserIpAddressPtr ipAddressPtr, | |
unsigned short * mxPrefPtr | |
); |
Function Description
This function returns the IPv4 address for the next mail exchanger for this hostname. The record that immediately follows the record for lastIpAddress/lastPreference will be retrieved.
Parameters
- hostnameStr
- Hostname to resolve.
- lastIpAddress
- The IPv4 address of the last retrieved mail host for this host.
- lastPreference
- The preference value of the last retrieved mail host for this host.
- ipAddressPtr
- Set to the IPv4 address of the host.
- mxPrefPtr
- Set to the preference value of the mail host.
Returns
- TM_EINVAL
- The hostname string or IP address pointer was invalid.
- TM_EWOULDBLOCK
- There is currently a DNS lookup in progress. The user should continue to call tfDnsGetNextMailHost() with the same parameters until it returns a value other than TM_EWOULDBLOCK. This is only returned when the resolver is operating in non-blocking mode.
- TM_ENOERROR
- The DNS lookup was successful. The IP address is stored in ipAddressPtr and the preference value is stored in mxPrefPtr.