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

# CFHostClientContext

A structure containing user-defined data and callbacks for CFHost objects.

```
struct CFHostClientContext
```

## Topics

### Initializers

[`init()`](/documentation/CFNetwork/CFHostClientContext/init())

Initializes an object that contains user-defined data and callbacks for a network host.

[`init(version: CFIndex, info: UnsafeMutableRawPointer?, retain: CFAllocatorRetainCallBack?, release: CFAllocatorReleaseCallBack?, copyDescription: CFAllocatorCopyDescriptionCallBack?)`](/documentation/CFNetwork/CFHostClientContext/init(version:info:retain:release:copyDescription:))

Initializes an object that contains user-defined data and callbacks for a network host using the specified values.

### Instance Properties

[`var copyDescription: CFAllocatorCopyDescriptionCallBack?`](/documentation/CFNetwork/CFHostClientContext/copyDescription)

The callback used to create a descriptive string representation of the info pointer (or the data pointed to by the info pointer) for debugging purposes. This callback is called by the <doc://com.apple.documentation/documentation/CoreFoundation/CFCopyDescription(_:)> function.

[`var info: UnsafeMutableRawPointer?`](/documentation/CFNetwork/CFHostClientContext/info)

An arbitrary pointer to allocated memory containing user-defined data that can be associated with the host and that is passed to the callbacks.

[`var release: CFAllocatorReleaseCallBack?`](/documentation/CFNetwork/CFHostClientContext/release)

The callback used to remove a retain previously added for the host on the info pointer.

[`var retain: CFAllocatorRetainCallBack?`](/documentation/CFNetwork/CFHostClientContext/retain)

The callback used to add a retain for the host on the info pointer for the life of the host, and may be used for temporary references the host needs to take. This callback returns the actual info pointer to store in the host, almost always just the pointer passed as the parameter.

[`var version: CFIndex`](/documentation/CFNetwork/CFHostClientContext/version)

The version number of the structure type passed as a parameter to the host client function. The only valid version number is `0`.

## Relationships

### Conforms To

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

---

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)