MohanVydehi
MohanVydehi

Reputation: 57

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:@""];

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.

Upvotes: 0

Views: 525

Answers (1)

D.C.
D.C.

Reputation: 15588

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

Upvotes: 1

Related Questions