CFMachPortCallBack
Callback invoked to process a message received on a CFMachPort object.
Declaration
typealias CFMachPortCallBack = (CFMachPort?, UnsafeMutableRawPointer?, CFIndex, UnsafeMutableRawPointer?) -> VoidParameters
- port:
The CFMachPort object on which the message
msgwas received. - msg:
The Mach message received on
port. The pointer is to amach_msg_header_tstructure. - size:
Size of the Mach message
msg, excluding the message trailer. - info:
The
infomember of the Cfmachportcontext structure used when creatingport.
Discussion
You specify this callback when creating a CFMachPort object with either CFMachPortCreate(_:_:_:_:) or CFMachPortCreateWithPort(_:_:_:_:_:). To receive messages on a CFMachPort object (and have this callback invoked), you must create a run loop source for the port and add it to a run loop.