CFHostClientCallBack
Defines a pointer to the callback function that is called when an asynchronous resolution of a CFHost completes or an error occurs for an asynchronous CFHost resolution.
Declaration
typealias CFHostClientCallBack = (CFHost, CFHostInfoType, UnsafePointer<CFStreamError>?, UnsafeMutableRawPointer?) -> VoidParameters
- theHost:
The host for which an asynchronous resolution has been completed.
- typeInfo:
Value of type
CFHostInfoTyperepresenting the type of information (addresses, names, or reachability information) obtained by the completed resolution. See Cfhostinfotype for possible values. - error:
If the resolution failed, contains a doc://com.apple.documentation/documentation/corefoundation/cfstreamerror structure whose
errorfield contains an error code. - info:
User-defined context information. The value pointed to by
infois the same as the value pointed to by theinfofield of the Cfhostclientcontext structure that was provided when the host was associated with this callback function.
Discussion
If you name your callback MyHostClientCallBack, you would declare it like this:
Discussion
The callback function for a CFHost object is called one or more times when an asynchronous resolution completes for the specified host, when an asynchronous resolution is cancelled, or when an error occurs during an asynchronous resolution.