z/OS Communications Server: IP IMS Sockets Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Client Read/Write calls — the conversation

z/OS Communications Server: IP IMS Sockets Guide
SC27-3653-00

A variety of I/O calls is available to the programmer. The READ and WRITE, READV and WRITEV, and SEND 6 and RECV 6 calls can be used only on sockets that are in the connected state. The SENDTO and RECVFROM, and SENDMSG and RECVMSG calls can be used regardless of whether a connection exists.

The WRITEV, READV, SENDMSG, and RECVMSG calls provide the additional features of scatter and gather data. Scattered data can be located in multiple data buffers. The WRITEV and SENDMSG calls gather the scattered data and send it. The READV and RECVMSG calls receive data and scatter it into multiple buffers.

The WRITE and READ calls specify the socket S on which to communicate, the address in storage of the buffer that contains, or will contain, the data (BUF), and the amount of data transferred (NBYTE). The server uses the socket that is returned from the ACCEPT call.

These functions return the amount of data that was either sent or received. Because stream sockets send and receive information in streams of data, it can take more than one call to WRITE or READ to transfer all of the data. It is up to the client and server to agree on some mechanism of signaling that all of the data has been transferred.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014