Why do I need socketpair() when I have socket() with AF_UNIX?
问题 What confuses me is that given that sockets are bi-directional, why can't I just open 1 socket with socket() on the client and one on the server and let them communicate over this single socket? What would be a common use case that I would need a pair of sockets? 回答1: So what is the common use case that I would need a pair of sockets? Typically that you want bidirectional communication between a parent and child process (or sometimes between threads in the same process). It's like a