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

# CFHostClientCallBack

Defines a pointer to the callback function that is called when an asynchronous resolution of a CFHost completes or an error occurs for an asynchronous CFHost resolution.

```
typealias CFHostClientCallBack = (CFHost, CFHostInfoType, UnsafePointer<CFStreamError>?, UnsafeMutableRawPointer?) -> Void
```

## Parameters

`theHost`

The host for which an asynchronous resolution has been completed.

`typeInfo`

Value of type `CFHostInfoType` representing the type of information (addresses, names, or reachability information) obtained by the completed resolution. See [`CFHostInfoType`](/documentation/CFNetwork/CFHostInfoType) for possible values.

`error`

If the resolution failed, contains a <doc://com.apple.documentation/documentation/CoreFoundation/CFStreamError> structure whose `error` field contains an error code.

`info`

User-defined context information. The value pointed to by `info` is the same as the value pointed to by the `info` field of the [`CFHostClientContext`](/documentation/CFNetwork/CFHostClientContext) structure that was provided when the host was associated with this callback function.

## Discussion

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

### Discussion

The callback function for a CFHost object is called one or more times when an asynchronous resolution completes for the specified host, when an asynchronous resolution is cancelled, or when an error occurs during an asynchronous resolution.

---

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)