====== UNIX Domain Socket (Socket) ====== [[dido:public:ra:xapend:xapend.a_glossary:start| Return to Glossary ]] A **[[dido:public:ra:xapend:xapend.a_glossary:u:unix]] Domain Socket (Socket)** or **Inter-Process Communication Socket (IPC socket)** is a data communications [[dido:public:ra:xapend:xapend.a_glossary:e:endpoint|endpoint]] for exchanging data between processes executing on the same host [[dido:public:ra:xapend:xapend.a_glossary:o:os|operating system]]. Valid socket types in the UNIX domain are: * SOCK_STREAM (compare to [[dido:public:ra:xapend:xapend.a_glossary:t:tcp]]) – for a stream-oriented socket * SOCK_DGRAM (compare to dido:public:ra:xapend:xapend.a_glossary:u:udp) – for a datagram-oriented socket that preserves message boundaries (as on most UNIX implementations, UNIX domain datagram sockets are always reliable and don't reorder datagrams) * SOCK_SEQPACKET (compare to [[dido:public:ra:xapend:xapend.a_glossary:s:sctp]]) – for a [[dido:public:ra:xapend:xapend.a_glossary:s:spx]] that is connection-oriented, preserves message boundaries, and delivers messages in the order that they were sent The UNIX domain socket facility is a standard component of [[dido:public:ra:xapend:xapend.a_glossary:p:posix]] operating systems. The [[dido:public:ra:xapend:xapend.a_glossary:a:api|API]] for UNIX Domain Sockets is similar to that of an Internet socket, but rather than using an underlying network protocol, all communication occurs entirely within the operating system kernel. UNIX Domain Sockets may use the file system as their address namespace. (Some operating systems, like Linux, offer additional namespaces.) Processes reference UNIX Domain Sockets as file system inodes, so two processes can communicate by opening the same socket. In addition to sending data, processes may send file descriptors across a UNIX Domain Socket connection using the ''sendmsg()'' and ''recvmsg()'' system calls. This allows the sending processes to grant the receiving process access to a file descriptor for which the receiving process otherwise does not have access. This can be used to implement a rudimentary form of capability-based security. For example, this allows the Clam AntiVirus scanner to run as an unprivileged [[dido:public:ra:xapend:xapend.a_glossary:d:daemon|daemon]] on Linux and BSD, yet still read any file sent to the daemon's Unix domain socket. Source: [[URIhttps://en.wikipedia.org/wiki/Unix_domain_socket]] /**=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- /* To add a discussion page to this page, comment out the line that says ~~DISCUSSION:off~~ */ ~~DISCUSSION:on|Outstanding Issues~~ ~~DISCUSSION:off~~