AECreateRemoteProcessResolver(_:_:)
Creates an object for resolving a list of remote processes.
Declaration
func AECreateRemoteProcessResolver(_ allocator: CFAllocator!, _ url: CFURL!) -> AERemoteProcessResolverRef!Parameters
- allocator:
An object that is used to allocates and deallocate any Core Foundation types created or returned by this API. You can pass
kCFAllocatorDefaultto get the default allocation behavior. The allocator is based onCFAllocatorRef, an opaque data type described in the Core Foundation Reference Documentation. - url:
A
CFURLreference identifying the remote host and port on which to look for processes. See the Core Foundation Reference Documentation for a description of theCFURLRefdata type.
Return Value
An AERemoteProcessResolverRef, which must be disposed of with AEDisposeRemoteProcessResolver(_:). A resolver can only be used one time; once it has obtained a list of remote processes from a server, or gotten an error, it can no longer be scheduled. To retrieve a new list of processes, create a new instance of this object.
Discussion
You supply this function with the URL for a remote host and port; it returns a reference to a resolver object. To obtain a list of remote processes from the resolver, you can query it synchronously with AERemoteProcessResolverGetProcesses(_:_:), which blocks until the request completes (either successfully or with an error).
If asynchronous behavior is desired, you can optionally use AERemoteProcessResolverScheduleWithRunLoop(_:_:_:_:_:) to schedule the resolver asynchronously on a run loop. If so, you supply a callback routine (see AERemoteProcessResolverCallback) that is executed when the resolver completes. To obtain information about the remote processes, you will again have to call AERemoteProcessResolverGetProcesses(_:_:).
A resolver can only be used once; once it has fetched the data or gotten an error it can no longer be scheduled. The data obtained by the resolver is a CFArrayRef of CFDictionaryRef objects. For information on the format of the returned remote process information, see the description of the function result for the function AERemoteProcessResolverGetProcesses(_:_:), and also Remote Process Dictionary Keys.
Version-Notes
Thread safe starting in OS X v10.3.