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

# CFNetServiceClientContext

A structure provided when a CFNetService is associated with a callback function or when a CFNetServiceBrowser is created.

```
struct CFNetServiceClientContext
```

## Topics

### Initializers

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

Creates an object that contains user-defined data and callbacks for net service browsers.

[`init(version:info:retain:release:copyDescription:)`](/documentation/CFNetwork/CFNetServiceClientContext/init(version:info:retain:release:copyDescription:))

Creates an object that contains user-defined data and callbacks for net service browsers using the specified values.

### Instance Properties

[`copyDescription`](/documentation/CFNetwork/CFNetServiceClientContext/copyDescription)

Callback used to create a descriptive string representation of the data pointed to by `info`. In implementing this function, return a reference to a CFString object that describes your allocator and some characteristics of your user-defined data, which is used by `CFCopyDescription()`. You can set this field to `NULL`, in which case Core Foundation will provide a rudimentary description.

[`info`](/documentation/CFNetwork/CFNetServiceClientContext/info)

Arbitrary pointer to user-allocated memory containing user-defined data that is associated with the service, browser, or monitor and is passed to their respective callback functions. The data must be valid for as long as the CFNetService, CFNetServiceBrowser, or CFNetServiceMonitor is valid. Set this field to `NULL` if your callback function doesn’t want to receive user-defined data.

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

Callback that removes a retain previously added for the service or browser on the `info` pointer. This field can be `NULL`, but setting this field to `NULL` may result in memory leaks.

[`retain`](/documentation/CFNetwork/CFNetServiceClientContext/retain)

The callback used to add a retain for the service or browser using `info` for the life of the service or browser. This callback may be used for temporary references the service or browser needs to take. This callback returns the actual `info` pointer so it can be stored in the service or browser. This field can be `NULL`.

[`version`](/documentation/CFNetwork/CFNetServiceClientContext/version)

Version number for this structure. Currently the only valid value is zero.



---

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)