<!--
{
  "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:info:retain:release:copyDescription:)`](/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

[`copyDescription`](/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.

[`info`](/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.

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

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

[`retain`](/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.

[`version`](/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)