Creates an instance of a NetServiceMonitor object that watches for record changes.
- iOS 2.0+
- macOS 10.4+
- Mac Catalyst 13.0+
- tvOS 9.0+
The allocator to use to allocate memory for the new object. Pass
kto use the current default allocator.
CFNetService to be monitored.
Pointer to callback function that is to be called when a record associated with
thechanges; cannot be
Pointer to user-defined contextual information that is to be passed to the callback specified by
clientwhen the callback is called; cannot be
NULL. For details, see
Service Client Context
A new instance of a CFNetServiceMonitor, or
NULL if the monitor could not be created. Ownership follows the The Create Rule.
This function creates a CFNetServiceMonitor that watches for changes in records associated with
If the CFNetServiceMonitor is to run in asynchronous mode, call
CFNet to schedule the monitor on a run loop. Then call
CFNet to start monitoring. When a change occurs, the callback function specified by
client will be called. For details, see
If the CFNetServiceMonitor is to run in synchronous mode, call
To stop a monitor that is running in synchronous mode, call
If you no longer need to monitor record changes, call
CFNet to stop the monitor and then call
CFNetto invalidate the monitor so it cannot be used again. Then call
CFRelease to release the memory associated with CFNetServiceMonitorRef.
This function is thread safe.