<!--
{
  "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/CFNetServiceClientCallBack",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "CFNetwork"
    ],
    "preciseIdentifier" : "c:@T@CFNetServiceClientCallBack"
  },
  "title" : "CFNetServiceClientCallBack"
}
-->

# CFNetServiceClientCallBack

Defines a pointer to the callback function for a CFNetService.

```
typealias CFNetServiceClientCallBack = (CFNetService, UnsafeMutablePointer<CFStreamError>?, UnsafeMutableRawPointer?) -> Void
```

## Parameters

`theService`

CFNetService associated with this callback function.

`error`

Pointer to a <doc://com.apple.documentation/documentation/CoreFoundation/CFStreamError> structure whose `error` field contain may contain an error code.

`info`

User-defined context information. The value of `info` is the same as the value of the `info` field of the [`CFNetServiceClientContext`](/documentation/CFNetwork/CFNetServiceClientContext) structure that was provided when [`CFNetServiceSetClient(_:_:_:)`](/documentation/CFNetwork/CFNetServiceSetClient(_:_:_:)) was called for the CFNetService associated with this callback function.

## Discussion

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

### Discussion

Your callback function will be called when there are results of resolving a CFNetService to report or when there are registration errors to report. In the case of resolution, if the service has more than one IP address, your callback will be called once for each address.

---

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)