jens@26: // jens@26: // MYBonjourBrowser.h jens@26: // MYNetwork jens@26: // jens@26: // Created by Jens Alfke on 1/22/08. jens@26: // Copyright 2008 Jens Alfke. All rights reserved. jens@26: // jens@26: jens@28: #import "MYDNSService.h" jens@31: @class MYBonjourRegistration; jens@26: jens@26: jens@26: /** Searches for Bonjour services of a specific type. */ jens@28: @interface MYBonjourBrowser : MYDNSService jens@26: { jens@26: @private jens@26: NSString *_serviceType; jens@26: BOOL _browsing; jens@26: Class _serviceClass; jens@26: NSMutableSet *_services, *_addServices, *_rmvServices; jens@31: BOOL _pendingUpdate; jens@31: MYBonjourRegistration *_myRegistration; jens@59: id _delegate; jens@26: } jens@26: jens@50: /** Initializes a new MYBonjourBrowser. jens@26: Call -start to begin browsing. jens@26: @param serviceType The name of the service type to look for, e.g. "_http._tcp". */ jens@26: - (id) initWithServiceType: (NSString*)serviceType; jens@26: jens@59: @property (assign) id delegate; jens@59: jens@26: /** Is the browser currently browsing? */ jens@26: @property (readonly) BOOL browsing; jens@26: jens@26: /** The set of currently found services. These are instances of the serviceClass, jens@50: which is MYBonjourService by default. jens@26: This is KV-observable. */ jens@26: @property (readonly) NSSet *services; jens@26: jens@26: /** The class of objects to create to represent services. jens@50: The default value is [MYBonjourService class]; you can change this, but only jens@26: to a subclass of that. */ jens@26: @property Class serviceClass; jens@26: jens@31: /** My own registration for this service type. jens@31: This object is created on demand and won't be started up until you tell it to. jens@31: Before starting it, you'll need to set its port, and optionally its name. jens@31: Your own registration will _not_ be visible in the set of services.*/ jens@31: @property (readonly) MYBonjourRegistration *myRegistration; jens@31: jens@26: @end