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

# CFNetServiceBrowserClientCallBack

Defines a pointer to the callback function for a CFNetServiceBrowser.

```
typealias CFNetServiceBrowserClientCallBack = (CFNetServiceBrowser, CFOptionFlags, CFTypeRef?, UnsafeMutablePointer<CFStreamError>?, UnsafeMutableRawPointer?) -> Void
```

## Parameters

`browser`

The CFNetServiceBrowser associated with this callback function.

`flags`

Flags conveying additional information. The `kCFNetServiceFlagIsDomain` bit is set if `domainOrService` contains a domain; if this bit is not set, `domainOrService` contains a CFNetService instance. For additional bit values, see `CFNetServiceBrowserClientCallBack Bit Flags`.

`domainOrService`

A string containing a domain name if this callback function is being called as a result of calling [`CFNetServiceBrowserSearchForDomains(_:_:_:)`](/documentation/CFNetwork/CFNetServiceBrowserSearchForDomains(_:_:_:)), or a CFNetService instance if this callback function is being called as a result calling [`CFNetServiceBrowserSearchForServices(_:_:_:_:)`](/documentation/CFNetwork/CFNetServiceBrowserSearchForServices(_:_:_:_:)).

`error`

A pointer to a <doc://com.apple.documentation/documentation/CoreFoundation/CFStreamError> structure whose `error` field 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 [`CFNetServiceBrowserCreate(_:_:_:)`](/documentation/CFNetwork/CFNetServiceBrowserCreate(_:_:_:)) was called to create the CFNetServiceBrowser associated with this callback function.

## Discussion

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

### Discussion

The callback function for a CFNetServiceBrowser is called one or more times when domains or services are found as the result of calling [`CFNetServiceBrowserSearchForDomains(_:_:_:)`](/documentation/CFNetwork/CFNetServiceBrowserSearchForDomains(_:_:_:)) and [`CFNetServiceBrowserSearchForServices(_:_:_:_:)`](/documentation/CFNetwork/CFNetServiceBrowserSearchForServices(_:_:_:_:)).

---

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)