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. The basic set of socket types is defined in the <SYS\SOCKET.H> file:

/*Standard socket types */

#define  SOCK_STREAM            1 /*virtual circuit*/

#define  SOCK_DGRAM             2 /*datagram*/

#define  SOCK_RAW               3 /*raw socket*/

#define  SOCK_SEQPACKET         5 /*sequenced packet stream*/

Other socket types can be defined.

OS/2 supports the basic set of sockets:

SOCK_DGRAM

SOCK_STREAM SOCK_RAW SOCK_SEQPACKET

Topics


[Back: Connection Modes]
[Next: Socket Types Summary]