Transferring Data
Sockets include a variety of calls for sending and receiving data.
The usual read and write subroutines can be used on sockets that are in a connected state. Additional socket subroutines permit callers to specify or receive the address of the peer socket. These calls are useful for connectionless sockets, in which the peer sockets can vary on each message transmitted or received. The sendmsg and recvmsg subroutines support the full interface to the IPC facilities. Besides offering scatter-gather operations, these calls allow an address to be specified or received and support flag options.