Socket types
Sockets have types that reflect the communication properties visible to a
user.
Processes are presumed to communicate only between sockets of
the same type, although there is
nothing that prevents communication between sockets of different
types should the underlying communication
protocols support this.
There are several types of sockets currently available:
-
A stream
socket provides for the bi-directional, reliable,
sequenced, and unduplicated flow of data without record boundaries.
A pair of connected stream sockets provides an interface nearly identical
to that of pipes.
-
A datagram socket supports bi-directional flow of data that is not
promised to be sequenced, reliable, or unduplicated.
That is, a process
receiving messages on a datagram socket may find messages duplicated
and possibly in an order different from the order in which they were
sent.
An important characteristic of a datagram socket is that record
boundaries in the data are preserved.
Datagram sockets closely model the
facilities found in many contemporary packet switched networks such as
the Ethernet.
-
A raw socket provides access to the underlying communication
protocols that support socket abstractions.
These sockets are normally datagram oriented, although their
exact characteristics are dependent on the interface provided by
the protocol.
Raw sockets are not intended for the general user; they
have been provided mainly for users interested in developing new
communication protocols or gaining access to some of the more
esoteric facilities of an existing protocol.
The use of raw sockets is considered under
``Advanced topics''
below.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004