开发者

Bonjour functionality in iPhone

I'm new to bonjour networking. I want to find all the device using bonjour functionality. Right now I'm using sample code provided by "Standford". By using that I was able to find only my device, I was not able to find remaining device which are under the same domain.

For publishing I'm using:

self.netService = [[[NSNetService alloc] initWithDomain:@"" type:@"_sampleservice._tcp." name:[UIDevice currentDevice].name port:port] autorelease];
[self.netService publishWithOptions:NSNetServiceNoAutoRename];

For browsing same network:

[_browser searchForServicesOfType:@"_sampleservice._tcp" inDomain:@""];
开发者_StackOverflow社区

By using this I was able to find my own device name, But I want to detect all the surrounding devices have same network.

Please help me. Thank you so much.


Have you started by looking at the Bonjour overview? http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/NetServices/Introduction.html

If not, start there. Also have a look at the DNS Service Discovery programming guide: http://developer.apple.com/library/mac/#documentation/Networking/Conceptual/dns_discovery_api/Introduction.html#//apple_ref/doc/uid/TP30000964

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜