The sockets API was developed in response to the need for sophisticated interprocess communication facilities to meet the following goals:
The sockets API provides a generic interface that allows networking applications to use any protocol stack. After you pick the protocol stack, you can choose the type of socket that you want, based on the communication characteristics that you desire. For example, stream sockets offer a reliable method of data transmission without message boundaries, whereas datagram sockets offer message boundaries but do not guarantee reliability.