Re: MX Record lookup
Re: MX Record lookup
- Subject: Re: MX Record lookup
- From: Tomas Zahradnicky <email@hidden>
- Date: Sun, 21 Sep 2003 13:29:23 +0200
The exact notifier code i use is below.
to me, it seems perfectly fine, but apparently it isn't because it
doesnt work :)
I'd like to hear your comment on it.
The notifier looks OK. Here's a snippet which does it but in a
synchronous/blocking way. You can throw it in a separate Threads
Manager thread if you wish so and create a yielding notifier so it
won't block. If you want so, then don't forget to call
OTUseSyncIdleEvents.
You probably don't set the input parameter num to the max number of
entries you want to get. Remember there may be several entries in the
MX record. Not just one!
int main(void)
{
InetSvcRef ref;
OSStatus err = noErr;
UInt16 num = 1;
InetMailExchange mx = { 0, };
err = InitOpenTransportInContext(kInitOTForApplicationMask, NULL);
if( !err )
ref = OTOpenInternetServicesInContext(
OTCreateConfiguration(kDNRName), kNilOptions, &err, NULL);
if( !err )
err = OTSetSynchronous( ref );
if( !err )
err = OTSetBlocking( ref );
if( !err )
err = OTInetMailExchange( ref, "apple.com", &num, &mx );
return 0;
}
-Tomas
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.