iosbonjournsnetservicebrowser

Bonjour/Cocoa: Is the NSNetServerBrowser still listening if 'moreServicesComing' is NO?


When an NSNetServiceBrowser instance discovers a service, it calls the following method on its delegate:

- (void)netServiceBrowser:(NSNetServiceBrowser *)netServiceBrowser didFindService:(NSNetService *)netService moreComing:(BOOL)moreServicesComing

My question: if moreServicesComing is NO, does that mean that the browser instance has completely stopped listening for services, and you'll never get another update? Or does it just mean, "that's all for now," but it'll keep on searching?

(If NSNetServiceBrowser instances had a flag to indicate their state, this wouldn't be an issue. Unfortunately, they don't, so it's kind of a mystery.)


Solution

  • So after doing some tests where I had the service remove itself not long after it appeared on the network, it appears that yes, the NSNetServiceBrowser instance is still running.