z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Write operations

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

A socket is selected for writing, ready to be written, when:
  • TCP/IP can accept additional outgoing data.
  • A connection request is received in response to an ACCEPT macro.
  • A CONNECT call for a nonblocking socket, which has previously returned ERRNO 36 (EINPROGRESS), completes the connection.

The WRITE, WRITEV, SEND, SENDMSG, or SENDTO macros block when the data to be sent exceeds the amount that TCP/IP can accept. To avoid this, you can precede the write operation with a SELECT macro to ensure that the socket is ready for writing. After a socket is selected for WRITE, your program can determine the amount of TCP/IP buffer space available by issuing the GETSOCKOPT macro with the SO_SNDBUF option.

To determine if a socket is ready for the write operation, set the appropriate bit in WSNDMSK to 1.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014