How do sockets function as an IPC mechanism at the OS level?

Last updated 5 July 2026

  • A socket is a bidirectional endpoint exposed as a file descriptor, with kernel send/receive buffers, defined by domain (AF_UNIX, AF_INET) and type (SOCK_STREAM, SOCK_DGRAM).

  • Unix domain sockets are same-host, path-addressed and fast (no network stack). Network sockets use IP + port and work across machines.

  • Server does bind()/listen()/accept() and client does connect(). The result is full-duplex IPC between unrelated processes with one API from local to distributed.

  • https://medium.com/towardsdev/unix-domain-sockets-linux-ipc-guide-522256310712
  • https://oswalt.dev/2025/08/unix-domain-sockets/
All Operating Systems interview questions