Expand description
The control channel: one Unix socket per app connection, one message per
packet, descriptors as SCM_RIGHTS.
On Linux the socket is SOCK_SEQPACKET. macOS has no sequenced packets on
Unix sockets; there it is SOCK_DGRAM, which on a connected Unix pair is
just as reliable and ordered and keeps message boundaries. Its buffers are
sized for the largest message, and a peer’s close reads as a reset, which
this end then answers as closed from then on.
A packet longer than MAX_MESSAGE_BYTES or carrying more than
MAX_MESSAGE_FDS descriptors is truncated by the kernel; the receiver
sees the truncation flag and refuses the packet rather than read half a
message. Received descriptors are close-on-exec.
Structs§
- Channel
- One end of a control channel.
- Received
- A message received, with the descriptors that came with it.
Enums§
- Channel
Error - Why a channel could not carry a message.