---
title: CFNetServiceClientCallBack
framework: cfnetwork
role: symbol
role_heading: Type Alias
path: cfnetwork/cfnetserviceclientcallback
---

# CFNetServiceClientCallBack

Defines a pointer to the callback function for a CFNetService.

## Declaration

```swift
typealias CFNetServiceClientCallBack = (CFNetService, UnsafeMutablePointer<CFStreamError>?, UnsafeMutableRawPointer?) -> Void
```

## Parameters

- `theService`: CFNetService associated with this callback function.
- `error`: Pointer to a doc://com.apple.documentation/documentation/CoreFoundation/CFStreamError structure whose error field contain 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 doc://com.apple.cfnetwork/documentation/CFNetwork/CFNetServiceClientContext structure that was provided when doc://com.apple.cfnetwork/documentation/CFNetwork/CFNetServiceSetClient(_:_:_:) was called for the CFNetService associated with this callback function.

## Discussion

Discussion If you name your callback MyNetServiceClientCallBack, you would declare it like this: Discussion Your callback function will be called when there are results of resolving a CFNetService to report or when there are registration errors to report. In the case of resolution, if the service has more than one IP address, your callback will be called once for each address.

## See Also

### Data Types

- [CFHostClientCallBack](cfnetwork/cfhostclientcallback.md)
- [CFNetServiceBrowserClientCallBack](cfnetwork/cfnetservicebrowserclientcallback.md)
- [CFNetServiceMonitorClientCallBack](cfnetwork/cfnetservicemonitorclientcallback.md)
- [CFNetDiagnosticStatus](cfnetwork/cfnetdiagnosticstatus.md)
