• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: MX Record lookup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: MX Record lookup [additional]
      • From: Robert Kuilman <email@hidden>
    • Re: MX Record lookup
      • From: Robert Kuilman <email@hidden>
References: 
 >Re: MX Record lookup (From: Robert Kuilman <email@hidden>)

  • Prev by Date: Determining if the current network location is "Automatic"
  • Next by Date: Re: Determining if the current network location is "Automatic"
  • Previous by thread: Re: MX Record lookup
  • Next by thread: Re: MX Record lookup
  • Index(es):
    • Date
    • Thread