There are two types of #Sockets in Unix:
- Internet, for two processes on different machine
- Unix domain, for two processes on a single machine
There are two types of #Sockets in Unix:
Pipe provides a one-way flow of data, where the output of a process is directed into the input of another, which can be created using pipe()
#Unix System Call. Pass in a file descriptor array (of type int
) with a size of 2, the system call will return 2 file descriptors for use: fd[0]
for reading and fd[1]
for writing. A typical use case of Pipe is to establish a communication channel# between two related processes. The maximum amount of data allowed in the pipe (OS treats it like a Queue#) is usually 5120 bytes. In #unix, Pipe is implemented using #Unix Domain Sockets.