Communications Programming Concepts Socket Types and Protocols Socket subroutines take socket types and socket protocols as parameters. An application program specifying a socket type indicates the desired communication style for that socket or socket pair. An application program specifying a socket protocol indicates the desired type of service. This service must be within the allowable services of the protocol family. Socket Types Sockets are classified according to communication properties.
Processes usually communicate between sockets of the same type.
However, if the underlying communication protocols support the communication, sockets of different types can communicate. Each socket has an associated type, which describes the semantics of communications using that socket. The socket type determines the socket communication properties such as reliability, ordering, and prevention of duplication of messages. This type of socket is generally used for short messages, such as a name server or time server, since the order and reliability of message delivery is not guaranteed. A datagram socket supports the bidirectional flow of data, which is not sequenced, reliable, or unduplicated.