Type Alias

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?) -> Void

Parameters

theHost

The host for which an asynchronous resolution has been completed.

typeInfo

Value of type CFHostInfoType representing 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 CFStreamError structure whose error field contains an error code.

info

User-defined context information. The value pointed to by info is the same as the value pointed to by the info field 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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software