开发者

What is the framework/function used in Cocoa for detecting machines

开发者 https://www.devze.com 2022-12-17 07:09 出处:网络
I\'m trying to get a listing of machines in my local domain, specifically ones running a administrative web se开发者_StackOverflowrvice (_asip-webadmin). I\'ve been fooling with NSNetService but it wo

I'm trying to get a listing of machines in my local domain, specifically ones running a administrative web se开发者_StackOverflowrvice (_asip-webadmin). I've been fooling with NSNetService but it would seem that it's only good for Bonjour listings (as I can trap them just fine). I've tried something along the lines of:

[mySearch searchForServicesOfType:@"_asip-webadmin._tcp." inDomain:@"local."];

which results in utter failure, or should I say the debugger gives me a blank stare back. A point in the right direction is all I need. Thanks!


I was on the right track. The problem was I was using the wrong service name.
I mistakenly looked in etc/services for the service name, whereas I should have looked here:
http://www.dns-sd.org/servicetypes.html

The following line does work for what I needed:

[mySearch searchForServicesOfType:@"_servermgr._tcp." inDomain:@"local."];

Assume mySearch is of type NSNetServiceBrowser.

0

精彩评论

暂无评论...
验证码 换一张
取 消