Among others, socket technology provides us with several advantages (over other typical user mode IPC mechanisms such as pipes, SysV IPC/POSIX IPC mechanisms (message queues, shared memory, semaphores, and so on)), as follows:
- Bidirectional simultaneous data transfer (full duplex).
- Lossless on the internet, with at least with some transport layer protocols, such as TCP, and of course, on the localhost, which is the case here.
- High-speed data transfer, especially on localhost!
- Flow control semantics are always in effect.
- Asynchronous communication; messages can be queued, so the sender does not have to wait for the receiver.
- Especially with respect to our topic, in other user<->kernel communication paths (such as procfs, sysfs, debugfs, and ioctl), the user space app must initiate the transfer to the kernel space; with netlink sockets, the kernel can initiate a transfer.
- Also, with all the other mechanisms we have seen so far (procfs, sysfs, and debugfs...