Class: NSNetServiceBrowser
Overview
The NSNetServiceBrowser class defines an interface for finding published services on a network using multicast DNS. An instance of NSNetServiceBrowser is known as a network service browser.
Instance Method Summary (collapse)
-
- delegate
Returns the receiver’s delegate.
-
- init
Initializes an allocated NSNetServiceBrowser object.
-
- removeFromRunLoop:forMode:
Removes the receiver from the specified run loop.
-
- scheduleInRunLoop:forMode:
Adds the receiver to the specified run loop.
-
- searchForBrowsableDomains
Initiates a search for domains visible to the host.
-
- searchForRegistrationDomains
Initiates a search for domains in which the host may register services.
-
- searchForServicesOfType:inDomain:
Starts a search for services of a particular type within a specific domain.
-
- setDelegate:
Sets the receiver’s delegate.
-
- stop
Halts a currently running search or resolution.
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Method Details
- (Object) delegate
Returns the receiver’s delegate.
- (Object) init
Initializes an allocated NSNetServiceBrowser object.
- (Object) removeFromRunLoop(runLoop, forMode:runLoopMode)
Removes the receiver from the specified run loop. You can use this method in conjunction with scheduleInRunLoop:forMode: to transfer the receiver to a run loop other than the default one. Although it is possible to remove an NSNetService object completely from any run loop and then attempt actions on it, you must not do it.
- (Object) scheduleInRunLoop(runLoop, forMode:runLoopMode)
Adds the receiver to the specified run loop. You can use this method in conjunction with removeFromRunLoop:forMode: to transfer the receiver to a run loop other than the default one. You should not attempt to run the receiver on multiple run loops.
- (Object) searchForBrowsableDomains
Initiates a search for domains visible to the host. This method returns immediately. The delegate receives a netServiceBrowser:didFindDomain:moreComing: message for each domain discovered.
- (Object) searchForRegistrationDomains
Initiates a search for domains in which the host may register services. This method returns immediately, sending a netServiceBrowserWillSearch: message to the delegate if the network was ready to initiate the search. The delegate receives a subsequent netServiceBrowser:didFindDomain:moreComing: message for each domain discovered. Most network service browser clients do not have to use this method—it is sufficient to publish a service with the empty string, which registers it in any available registration domains automatically.
- (Object) searchForServicesOfType(serviceType, inDomain:domainName)
Starts a search for services of a particular type within a specific domain. This method returns immediately, sending a netServiceBrowserWillSearch: message to the delegate if the network was ready to initiate the search.The delegate receives subsequent netServiceBrowser:didFindService:moreComing: messages for each service discovered.The serviceType argument must contain both the service type and transport layer information. To ensure that the mDNS responder searches for services, rather than hosts, make sure to prefix both the service name and transport layer name with an underscore character (“_”). For example, to search for an HTTP service on TCP, you would use the type string “_http._tcp.“. Note that the period character at the end is required.The domainName argument can be an explicit domain name, the generic local domain @“local.” (note trailing period, which indicates an absolute name), or the empty string (@“”), which indicates the default registration domains. Usually, you pass in an empty string. Note that it is acceptable to use an empty string for the domainName argument when publishing or browsing a service, but do not rely on this for resolution.
- (Object) setDelegate(delegate)
Sets the receiver’s delegate. The delegate is not retained. The receiver calls the methods of your delegate to receive information about discovered domains and services.
- (Object) stop
Halts a currently running search or resolution. This method sends a netServiceBrowserDidStopSearch: message to the delegate and causes the browser to discard any pending search results.