Function

CFHostSetClient

Associates a client context and a callback function with a CFHost object or disassociates a client context and callback function that were previously set.

Declaration

Boolean CFHostSetClient(CFHostRef theHost, CFHostClientCallBack clientCB, CFHostClientContext *clientContext);

Parameters

theHost

The host to modify. The value must not be NULL.

clientCB

The callback function to associate with theHost. The callback function will be called when a resolution completes or is cancelled. If you are calling this function to disassociate a client context and callback from theHost, pclientCBass NULL.

clientContext

A CFHostClientContext structure whose info field will be passed to the callback function specified by clientCB when clientCB is called. This value must not be NULL when setting an association.

Pass NULL when disassociating a client context and a callback from a host.

Return Value

TRUE if the association could be set or unset, otherwise FALSE.

Discussion

The callback function specified by clientCB will be called when a resolution completes or is cancelled.

Special Considerations

This function is thread safe.

See Also

Hosts

CFHostRef

An opaque reference representing an CFHost object.

CFHostInfoType

Values indicating the type of data that is to be resolved or the type of data that was resolved.

CFHostClientContext

A structure containing user-defined data and callbacks for CFHost objects.

CFHostCancelInfoResolution

Cancels the resolution of a host.

CFHostCreateCopy

Creates a new host object by copying.

CFHostCreateWithAddress

Uses an address to create an instance of a host object.

CFHostCreateWithName

Uses a name to create an instance of a host object.

CFHostGetAddressing

Gets the addresses from a host.

CFHostGetNames

Gets the names from a CFHost.

CFHostGetReachability

Gets reachability information from a host.

CFHostGetTypeID

Gets the Core Foundation type identifier for the CFHost opaque type.

CFHostScheduleWithRunLoop

Schedules a CFHost on a run loop.

CFHostStartInfoResolution

Starts resolution for a host object.

CFHostUnscheduleFromRunLoop

Unschedules a CFHost from a run loop.