CFNetServiceBrowserStopSearch(_:_:)
Stops a search for domains or services.
Declaration
func CFNetServiceBrowserStopSearch(_ browser: CFNetServiceBrowser, _ error: UnsafeMutablePointer<CFStreamError>?)Parameters
- browser:
The CFNetServiceBrowser that was used to start the search; cannot be
NULL. - error:
A pointer to a doc://com.apple.documentation/documentation/corefoundation/cfstreamerror structure that will be passed to the callback function associated with this CFNetServiceBrowser (if the search is being conducted in asynchronous mode) or that is pointed to by the
errorparameter when Cfnetservicebrowsersearchfordomains(_:_:_:) or Cfnetservicebrowsersearchforservices(_:_:_:_:) returns (if the search is being conducted in synchronous mode). Set thedomainfield tokCFStreamErrorDomainCustomand theerrorfield to an appropriate value.
Discussion
This functions stops a search started by a previous call to CFNetServiceBrowserSearchForDomains(_:_:_:) or CFNetServiceBrowserSearchForServices(_:_:_:_:). For asynchronous and synchronous searches, calling this function causes the callback function associated with the CFNetServiceBrowser to be called once for each domain or service found. If the search is asynchronous, error is passed to the callback function. If the search is synchronous, calling this function causes CFNetServiceBrowserSearchForDomains(_:_:_:) or CFNetServiceBrowserSearchForServices(_:_:_:_:) to return FALSE. If the error parameter for either call pointed to a doc://com.apple.documentation/documentation/corefoundation/cfstreamerror structure, the doc://com.apple.documentation/documentation/corefoundation/cfstreamerror structure contains the error code and the error code’s domain as set when this function was called.
Special Considerations
This function is thread safe.
If you are stopping an asynchronous search, before calling this function, call CFNetServiceBrowserUnscheduleFromRunLoop(_:_:_:), followed by CFNetServiceBrowserInvalidate(_:).
See Also
Network Services
CFNetServiceCFNetServiceBrowserCFNetServiceBrowserFlagsCFNetServiceMonitorCFNetServiceMonitorTypeCFNetServiceClientContextCFNetServiceRegisterFlagsCFNetServicesErrorCFNetServiceBrowserInvalidate(_:)CFNetServiceBrowserScheduleWithRunLoop(_:_:_:)CFNetServiceBrowserCreate(_:_:_:)CFNetServiceBrowserGetTypeID()CFNetServiceBrowserSearchForDomains(_:_:_:)CFNetServiceBrowserSearchForServices(_:_:_:_:)CFNetServiceBrowserUnscheduleFromRunLoop(_:_:_:)