Instance Method


Starts a search for services of a particular type within a specific domain.


- (void)searchForServicesOfType:(NSString *)type inDomain:(NSString *)domainString;



Type of the service to search for.


Domain name in which to perform the search.


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.

See Also

Using Network Service Browsers

- searchForBrowsableDomains

Initiates a search for domains visible to the host. This method returns immediately.

- searchForRegistrationDomains

Initiates a search for domains in which the host may register services.

- searchForAllDomains

Initiates a search for all domains that are visible to the host.

- stop

Halts a currently running search or resolution.