-->

Sabtu, 07 Juli 2018

A Unix domain socket or IPC socket (inter-process communication socket) is a data communications endpoint for exchanging data between processes executing on the same host operating system. Like named pipes, Unix domain sockets support transmission of a reliable stream of bytes (SOCK_STREAM, compare to TCP). In addition, they support ordered and reliable transmission of datagrams (SOCK_SEQPACKET, compare to SCTP), or unordered and unreliable transmission of datagrams (SOCK_DGRAM, compare to UDP). The Unix domain socket facility is a standard component of POSIX operating systems.

The 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 use the file system as their address name space. 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 daemon on Linux and BSD, yet still read any file sent to the daemon's Unix domain socket.

See also




Christian Heimes - File descriptors, Unix sockets and other POSIX wizardry - PyCon 2016 - Speaker: Christian Heimes Have you ever wondered how the OS manages open files and network connections, what this 'file descriptor' thing actually is all ...

  • Raw socket
  • Datagram socket
  • Stream socket
  • Network socket
  • Berkeley sockets
  • Pipeline

References


ðŸ
ðŸ"ŽJulia EvansðŸ" on Twitter: "unix domain sockets… ". Source : twitter.com

External links


Screen+Shot+2017-07-29+at+5.37 ...
Screen+Shot+2017-07-29+at+5.37 .... Source : rubyplus.com

  • socketpair â€" System Interfaces Reference, The Single UNIX Specification, Issue 7 from The Open Group
  • sendmsg â€" System Interfaces Reference, The Single UNIX Specification, Issue 7 from The Open Group
  • recvmsg â€" System Interfaces Reference, The Single UNIX Specification, Issue 7 from The Open Group
  • cmsg(3) â€" Linux Programmer's Manual â€" Library Functions
  • ucspi-unix, UNIX-domain socket client-server command-line tools
  • Unix sockets vs Internet sockets
  • Unix Sockets - Beej's Guide to Unix IPC



ðŸ
ðŸ"ŽJulia EvansðŸ" on Twitter: "unix domain sockets… ". Source : twitter.com

 
Sponsored Links