As an example, consider the socket system calls for a connection-oriented protocol. The socket interface is differentiated by the different services that are provided. Stream, datagram, and raw sockets each define a different service available to applications.
Data is sent without errors or duplication and is received in the same order as it is sent.
Flow control is built-in to avoid data overruns. No boundaries are imposed on the exchanged data, which is considered to be a stream of bytes. Datagrams are sent as independent packets. No disassembly and reassembly of packets is performed. This interface is often used for testing new protocol implementations.