- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
CFMessagePort objects provide a communications channel that can transmit arbitrary data between multiple threads or processes on the local machine.
You create a local message port with
CFMessage and make it available to other processes by giving it a name, either when you create it or later with
CFMessage. Other processes then connect to it using
CFMessage, specifying the name of the port.
Your message port’s callback function will be called when a message arrives. To send data, you store the data in a CFData object and call
CFMessage. You can optionally have the function wait for a reply and return the reply in another CFData object.
Message ports only support communication on the local machine. For network communication, you have to use a CFSocket object.