Programming with sockets

The original UNIX socket interface was designed to hide the physical details of the network. It included the concept of a socket, which represents the connection to the programmer, yet shields the program (as much as possible) from the details of communication programming. A socket is an endpoint for communication that can be named and addressed in a network. From an application program perspective, a socket is a resource that is allocated by the TCP/IP address space. A socket is represented to the program by an integer called a socket descriptor.