O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

For the More Curious: TXT Records

Besides the standard information for a service (host, port, name), the DNS record used to publish the services has a TXT record. This is a place where you can put any sort of data that clients might want to know about. For example, your chatter server might want to advertise the number of users already connected. It could use the TXT record to do this. NSNetService has a method that would be used on the server side:

- (BOOL) setTXTRecordData: (NSData *) data;

On the client side, you would ask the NSNetService for the data using:

- (NSData *)TXTRecordData;

Of course, the server might change the TXT record. (For example, if more people subscribe, your chatterd server would want to change the advertised number of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required