<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CFNetwork",
  "identifier" : "/documentation/CFNetwork/CFNetServiceMonitorClientCallBack",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "CFNetwork"
    ],
    "preciseIdentifier" : "c:@T@CFNetServiceMonitorClientCallBack"
  },
  "title" : "CFNetServiceMonitorClientCallBack"
}
-->

# CFNetServiceMonitorClientCallBack

Defines a pointer to the callback function that is to be called when a monitored record type changes.

```
typealias CFNetServiceMonitorClientCallBack = (CFNetServiceMonitor, CFNetService?, CFNetServiceMonitorType, CFData?, UnsafeMutablePointer<CFStreamError>?, UnsafeMutableRawPointer?) -> Void
```

## Parameters

`theMonitor`

CFNetServiceMonitor for which the callback is being called.

`theService`

CFNetService for which the callback is being called.

`typeInfo`

Type of record that changed. For possible values, see [`CFNetServiceMonitorType`](/documentation/CFNetwork/CFNetServiceMonitorType).

`rdata`

Contents of the record that changed.

`error`

Pointer to <doc://com.apple.documentation/documentation/CoreFoundation/CFStreamError> structure whose `error` field contains an error code if an error occurred.

`info`

Arbitrary pointer to the user-defined data that was specified in the `info` field of the `CFNetServiceClientContext` structure when the monitor was created by [`CFNetServiceMonitorCreate(_:_:_:_:)`](/documentation/CFNetwork/CFNetServiceMonitorCreate(_:_:_:_:)).

## Discussion

If you name your callback `MyNetServiceMonitorClientCallBack`, you would declare it like this:

### Discussion

The callback function will be called when the monitored record type changes or when the monitor is stopped by calling [`CFNetServiceMonitorStop(_:_:)`](/documentation/CFNetwork/CFNetServiceMonitorStop(_:_:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)