The CFHost API allows you to create instances of the CFHost object that you can use to acquire host information, including names, addresses, and reachability information.
- Core Services
The process of acquiring information about a host is known as resolution. Begin by calling
CFHost to create an instance of a CFHost using an address or a name, respectively. If you want to resolve the host asynchronously. call
CFHost to associate your client context and user-defined callback function with the host. Then call
CFHost to schedule the host on a run loop.
To start resolution, call
CFHost. If you set up for asynchronous resolution,
CFHost returns immediately. Your callback function will be called when resolution is complete. If you didn’t set up for asynchronous resolution,
CFHost blocks until resolution is complete, an error occurs, or the resolution is cancelled.
When resolution is complete, call
CFHost to get an array of known addresses or known names, respectively, for the host. Call
CFHost to get flags, declared in
System, that describe the reachability of the host.
When you no longer need a CFHost object, call
CFHost to disassociate the host from your user-defined client context and callback function (if it was set up for asynchronous resolution). Then dispose of it.