I can use NSNetServiceBrowser to resolve services, obtaining addresses,
domain, name and type. However, I can't see any way to obtain the
port or
the TXT record. I know a port and TXT record are being advertised (I
can
see them using command line applications).
I tried using the 'protocolSpecificInformation' method, which returns
an
NSString *, but this string came back empty.
Does the high level NSNetService API support this, or do I need to
call the
DNS-SD API directly?
An individual NSNetService instance may be publishing itself on
multiple ports or addresses. Once an NSNetService instance is resolved
you can get the array of addresses from the instance using the
-addresses method. Each entry is an NSData containing a struct
sockaddr_in (or the IPv6 version thereof) which you can pick at for the
port for that particular service.
You can see this in the example code at
/Developer/Examples/Foundation/Picture Sharing Browser in the
-netServiceDidResolveAddress: method (look for "if (socketAddress)" in
the code).
-protocolSpecificInformation was unfortunately pretty much deprecated
at publication, so you may have to use the raw DNS-SD APIs if that's
vital to you for arbitrary items, but for information published in a
like manner (i.e. the other side called -setProtocolSpecificInformation
on the NSNetService instance it's publishing) it should work.
.chris
--
Chris Parker
Cocoa Frameworks
Apple Computer, Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Rendezvous-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/rendezvous-dev/email@hidden