tfDnsGetMailHost

Jump to: navigation, search

Table of Contents >> Application Reference >> DNS Resolver


#include <trsocket.h>


int tfDnsGetMailHost (
const char * hostnameStr,
ttUserIpAddressPtr ipAddressPtr,
unsigned short * mxPrefPtr
);


Function Description

This function retrieves the IPv4 address of the first MX record for this hostname.


Parameters

  • hostnameStr
    Hostname to resolve.
  • 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 tfDnsGetMailHost() 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.


Table of Contents >> Application Reference >> DNS Resolver