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


SELECT

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

In a process where multiple I/O operations can occur it is necessary for the program to be able to wait on one or several of the operations to complete. For example, consider a program that issues a READ to multiple sockets whose blocking mode is set. Because the socket would block on a READ macro, only one socket could be read at a time. Setting the sockets to nonblocking would solve this problem, but would require polling each socket repeatedly until data becomes available. The SELECT macro allows you to test several sockets and to process a later I/O macro only when one of the tested sockets is ready. This ensures that the I/O macro does not block.

Tip: You do not need to use the SELECT macro when you are using APITYPE=3 (asynchronous) calls. Simply issue the intended call and let the specified notification mechanism (ECB or exit routine) take effect.
To use the SELECT macro as a timer in your program, take either of the following actions:
  • Set the read, write, and exception arrays to zeros.
  • Do not specify MAXSOC.
The following requirements apply to this call:

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014