ROZeroConfBrowser
Overview
The ROZeroConfBrowser class is a facility to support client-side zero configuration networking in RO SDK for Xcode applications. Its functionality is based on Cocoa's NSNetServiceBrowser class. In addition, the ROZeroConfBrowser class is able to keep a list of available services of a specified type and provides an easier way to specify the RO SDK service type to browse for (notice that this class browses for RO SDK services only!). The class instance works mainly in an asynchronous manner and is able to notify its delegate object about service availability changes.
Location
- Reference: ROZeroConfBrowser.h
- Namespace: RemObjectsSDK
- Ancestry: NSObject | ROZeroConfBrowser
browserWithServiceType:
Allocates the new service browser instance and prepares it to browse for services of the given type. The browsing is not started.
+ (id) browserWithServiceType:(NSString *)aServiceType
Parameters:
- aServiceType: The service type to browse for. The same naming rule as for the
serviceType
property is applied here.
delegate assign
@property (assign) id delegate
initWithServiceType:
- (InstanceType) initWithServiceType:(NSString *)aServiceType
Parameters:
- aServiceType:
services
Provides read-only access to the current available services list. This property returns a dictionary with the service name as a key and a NSNetService object as a value.
@property (readonly) NSDictionary *services
serviceType nonatomic retain
Gets or sets the service type to browse for. The service browser instance is able to browse for only one service type at a time (if you need to browse for several service types, you will need to create a corresponding number of browsers).
This property works with a distinctive name of the RO SDK service, not with the full domain name. Assuming you have a RO SDK service with the name BonjourDiscoverableService
, you have to specify the name for the property (case-insensitive) unlike in the generic NSNetServiceBrowser class, that requires to specify the full domain name _bonjourdiscoverableservice_rosdk._tcp.
.
After the property is set, the service browser will stop browsing if it was active and the services list will be cleared.
@property (nonatomic, retain) NSString *serviceType
startBrowsing
Use this method to start the browsing process after the service type name has been set. Calling this method does not clear the current services list.
- (void) startBrowsing
stopBrowsing
Use this method to stop the browsing process. Calling this method does not clear the current services list.
- (void) stopBrowsing
delegate assign
@property (assign) id delegate
services
Provides read-only access to the current available services list. This property returns a dictionary with the service name as a key and a NSNetService object as a value.
@property (readonly) NSDictionary *services
serviceType nonatomic retain
Gets or sets the service type to browse for. The service browser instance is able to browse for only one service type at a time (if you need to browse for several service types, you will need to create a corresponding number of browsers).
This property works with a distinctive name of the RO SDK service, not with the full domain name. Assuming you have a RO SDK service with the name BonjourDiscoverableService
, you have to specify the name for the property (case-insensitive) unlike in the generic NSNetServiceBrowser class, that requires to specify the full domain name _bonjourdiscoverableservice_rosdk._tcp.
.
After the property is set, the service browser will stop browsing if it was active and the services list will be cleared.
@property (nonatomic, retain) NSString *serviceType
browserWithServiceType:
Allocates the new service browser instance and prepares it to browse for services of the given type. The browsing is not started.
+ (id) browserWithServiceType:(NSString *)aServiceType
Parameters:
- aServiceType: The service type to browse for. The same naming rule as for the
serviceType
property is applied here.
initWithServiceType:
- (InstanceType) initWithServiceType:(NSString *)aServiceType
Parameters:
- aServiceType:
startBrowsing
Use this method to start the browsing process after the service type name has been set. Calling this method does not clear the current services list.
- (void) startBrowsing
stopBrowsing
Use this method to stop the browsing process. Calling this method does not clear the current services list.
- (void) stopBrowsing