next up previous
Next: Connectionless Sockets Up: Introduction Previous: Connection Establishment

Data Transfer

With a connection established, data may begin to flow. To send and receive data there are a number of possible calls. With the peer entity at each end of a connection anchored, a user can send or receive a message without specifying the peer. As one might expect, in this case, then the normal read and write system calls are usable,

write(s, buf, sizeof (buf));
read(s, buf, sizeof (buf));
In addition to read and write, the new calls send and recv may be used:
send(s, buf, sizeof (buf), flags);
recv(s, buf, sizeof (buf), flags);
The send and recv are virtually identical to read and write, and the extra flags argument is important only in special circumstances.



Prasun Dewan
Mon Mar 27 11:27:55 EST 2000