Contents

CFNetServiceMonitorStop(_:_:)

Stops a CFNetServiceMonitor.

Declaration

func CFNetServiceMonitorStop(_ monitor: CFNetServiceMonitor, _ error: UnsafeMutablePointer<CFStreamError>?)

Parameters

  • monitor:

    CFNetServiceMonitor, started by calling Cfnetservicemonitorstart(_:_:_:), that is to be stopped.

  • error:

    Pointer to a doc://com.apple.documentation/documentation/corefoundation/cfstreamerror structure or NULL. For synchronous monitors, set the error field of this structure to the non-zero value you want to be set in the CFStreamError structure when Cfnetservicemonitorstart(_:_:_:) returns. Note that when it returns, Cfnetservicemonitorstart(_:_:_:) returns FALSE. If the monitor was started asynchronously, set the error field to the non-zero value you want the monitor’s callback to receive when it is called. If this parameter is NULL, default values for the CFStreamError structure are used: the domain is set to kCFStreamErrorDomainNetServices and the error code is set to kCFNetServicesErrorCancel.

Discussion

This function stops the specified monitor. Call CFNetServiceMonitorStart(_:_:_:) if you want to start monitoring again.

If you want to stop monitoring and no longer need to monitor record changes, call CFNetServiceMonitorInvalidate(_:) instead of this function.

Special Considerations

This function is thread safe.

See Also

Network Services