Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Data transfer with connection-oriented communications

&pagelevel(4)&pagelevel

Data can be transferred as soon as a connection is set up. If the communications endpoints of both partners are hard-bound with each other via the addressing-pair, a user process can send and receive messages without having to specify the addressing-pair each time.

There are several functions for sending and receiving data. You can elect to use either the functions read() and write() or readv() and writev() :

write(s, buf, sizeof buf);
read(s, buf, sizeof buf);
writev(s, iovec, iovcnt); 
readv(s, iovec, iovcnt); 

These functions are part of the basic scope of the POSIX interface. They are described in the manual "C Library Functions for POSIX Applications". Socket-specific features of these functions are described in "Using standard POSIX functions for sockets".

You can alternatively use the following socket-specific functions:

send(s, buf, sizeof buf, flags);
sendmsg(s, msg, flags);
recv(s, buf, sizeof buf, flags);
recvmsg(s, msg, flags);

The socket-specific functions are described in detail in "Description of SOCKETS(POSIX) functions".