The basis for communication between processes centers on the socket mechanism. The socket is comparable to the operating system file-access mechanism that provides an end point for communication. Application programs request the operating system to create a socket through the use of socket subroutines. Subroutines used to create sockets are:
When an application program requests the creation of a new socket, the operating system returns an integer that the application program uses to reference the newly created socket. The socket descriptor is an unsigned integer that is the lowest unused number usable for a descriptor. The descriptor is indexed to the kernel descriptor table. A process can obtain a socket descriptor table by creating a socket or inheriting one from a parent process.
To create a socket with the socket subroutine, the application program must include a communication domain and a socket type. Also, it may include a specific communication protocol within the specified communication domain.
For additional information about creating sockets, read the following concepts: