Simple message protocol
Implemented by src/comms.c
This is a simple protocol for sending messages across a Unix socket created with socketpair(). It divides the stream into a series of messages which are not interpreted further. Each message contains data (an array of bytes) and an array of file descriptors.
PlashObjectCapabilityProtocol is layered on top of this protocol.
Messages
Each message consists of:
- int32: the 4 byte string: "MSG!"
- int32: size of data payload in bytes (not necessarily a word-aligned size)
- int32: number of file descriptors
- data payload, padded to a 4 byte boundary with zero bytes
See the man pages sendmsg(2), recvmsg(2) and cmsg(3) for details of how file descriptors are sent across sockets.
