---
title: "CFNetServiceMonitorStart(_:_:_:)"
framework: cfnetwork
role: symbol
role_heading: Function
path: "cfnetwork/cfnetservicemonitorstart(_:_:_:)"
---

# CFNetServiceMonitorStart(_:_:_:)

Starts monitoring.

## Declaration

```swift
func CFNetServiceMonitorStart(_ monitor: CFNetServiceMonitor, _ recordType: CFNetServiceMonitorType, _ error: UnsafeMutablePointer<CFStreamError>?) -> Bool
```

## Parameters

- `monitor`: CFNetServiceMonitor, created by calling doc://com.apple.cfnetwork/documentation/CFNetwork/CFNetServiceMonitorCreate(_:_:_:_:), that is to be started.
- `recordType`: CFNetServiceMonitorType that specified the type of record to monitor. For possible values, see doc://com.apple.cfnetwork/documentation/CFNetwork/CFNetServiceMonitorType.
- `error`: Pointer to a doc://com.apple.documentation/documentation/CoreFoundation/CFStreamError structure. If an error occurs, on output, the structure’s domain field will be set to the error code’s domain and the error field will be set to an appropriate error code. Set this parameter to NULL if you don’t want to receive the error code and its domain.

## Return Value

Return Value TRUE if an asynchronous monitor was started successfully. FALSE if an error occurred when starting an asynchronous or synchronous monitor, or if CFNetServiceMonitorStop(_:_:) was called for an synchronous monitor.

## Discussion

Discussion This function starts monitoring for changes to records of the type specified by recordType. If a monitor is already running for the service associated with the specified CFNetServiceMonitorRef, this function returns FALSE. For synchronous monitors, this function blocks until the monitor is stopped by calling CFNetServiceMonitorStop(_:_:), in which case, this function returns FALSE. For asynchronous monitors, this function returns TRUE or FALSE, depending on whether monitoring starts successfully. Special Considerations This function is thread safe.

## See Also

### Network Services

- [CFNetService](cfnetwork/cfnetservice.md)
- [CFNetServiceBrowser](cfnetwork/cfnetservicebrowser.md)
- [CFNetServiceBrowserFlags](cfnetwork/cfnetservicebrowserflags.md)
- [CFNetServiceMonitor](cfnetwork/cfnetservicemonitor.md)
- [CFNetServiceMonitorType](cfnetwork/cfnetservicemonitortype.md)
- [CFNetServiceClientContext](cfnetwork/cfnetserviceclientcontext.md)
- [CFNetServiceRegisterFlags](cfnetwork/cfnetserviceregisterflags.md)
- [CFNetServicesError](cfnetwork/cfnetserviceserror.md)
- [CFNetServiceBrowserInvalidate(_:)](cfnetwork/cfnetservicebrowserinvalidate(_:).md)
- [CFNetServiceBrowserScheduleWithRunLoop(_:_:_:)](cfnetwork/cfnetservicebrowserschedulewithrunloop(_:_:_:).md)
- [CFNetServiceBrowserCreate(_:_:_:)](cfnetwork/cfnetservicebrowsercreate(_:_:_:).md)
- [CFNetServiceBrowserGetTypeID()](cfnetwork/cfnetservicebrowsergettypeid().md)
- [CFNetServiceBrowserSearchForDomains(_:_:_:)](cfnetwork/cfnetservicebrowsersearchfordomains(_:_:_:).md)
- [CFNetServiceBrowserSearchForServices(_:_:_:_:)](cfnetwork/cfnetservicebrowsersearchforservices(_:_:_:_:).md)
- [CFNetServiceBrowserStopSearch(_:_:)](cfnetwork/cfnetservicebrowserstopsearch(_:_:).md)
