DNS Address Structure
You can use the DNS (domain name system) address structure with theOTConnectfunction when you are creating a TCP endpoint, with theOTSndUDatafunction when you are creating a UDP endpoint, or with theOTResolveAddressfunction with either TCP or UDP endpoints. If you do so, the domain name resolver (DNR) will resolve the address for you automatically. You can use theOTInitDNSAddressfunction (page 8-53) to fill in a DNS address structure. The DNS address structure is defined by theDNSAddressdata type.
struct DNSAddress { OTAddressType fAddressType;/* address type; always AF_DNS */ InetDomainName fName; /* domain name */ };This address you specify can be just the host name ("otteam"), a partially qualified domain name ("otteam.ssw"), a fully qualified domain name ("otteam.ssw.apple.com."), or an internet address in dotted-decimal format ("17.202.99.99"), and can optionally include the port number ("otteam.ssw.apple.com:25" or "17.202.99.99:25").
Field Description
fAddressType- The address type. The only possible value for this field is
AF_DNS.fName- The address to be resolved by the DNR.
Because the port number is not actually part of the domain name, it is possible to have a domain name-port number combination that exceeds 255 bytes. If you wish to specify such a string, you must provide a structure based on the DNS address structure that has sufficient space to contain the full string. In any case, the domain name itself cannot exceed 255 bytes.
You can use the DNS address structure to provide an unresolved TCP address with the
OTConnectfunction or a UDP address with theOTSndUDatafunction. To do so, specify a pointer to the DNS address structure as theudata->addr.bufparameter in your call to theOTSndUDatafunction or as thesndCall->addr.bufparameter in your call to theOTConnectfunction.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help