Home

Unixdomain

Unixdomain, commonly referred to as Unix domain sockets or local sockets, is an interprocess communication mechanism provided by Unix and Unix-like systems. It enables processes on the same host to exchange data with lower latency and overhead than network sockets by avoiding the network protocol stack. A Unixdomain socket is addressed using a local identifier, typically a pathname such as /tmp/server.sock; some implementations also support an abstract namespace not represented in the filesystem.

Unix domain sockets support two communication styles: stream-oriented (SOCK_STREAM), which provides a reliable, message-oriented byte stream,

Security and access control are managed through filesystem permissions on the socket node and through system

Compared with network sockets, Unix domain sockets are limited to communication within a single host, but they

Technical notes: the socket family is usually identified in APIs as AF_UNIX or AF_LOCAL, and the exact

and
datagram-oriented
(SOCK_DGRAM),
which
delivers
discrete
messages.
The
lifecycle
generally
involves
creating
a
socket,
binding
it
to
an
address,
and
then
either
listening
and
accepting
connections
(for
stream
sockets)
or
sending
and
receiving
datagrams
(for
datagram
sockets).
security
modules
such
as
SELinux
or
AppArmor.
When
using
the
filesystem-based
namespace,
the
socket
appears
as
a
special
file
whose
permissions
govern
which
processes
may
connect.
Linux
also
offers
an
abstract
namespace,
which
can
avoid
filesystem
permissions
but
is
not
portable
to
all
Unix
variants.
typically
offer
lower
latency
and
higher
throughput
for
IPC.
They
are
commonly
used
for
local
daemons,
services,
and
IPC
within
operating
system
components.
features
and
path
length
limits
vary
by
system.