SELECTEX

The SELECTEX macro monitors a set of sockets, a time value, and an ECB or list of ECBs.

It completes, if either one of the sockets has activity, the time value expires, or the ECBs are posted.

To use the SELECTEX call as a timer in your program, do either of the following:
  • Set the read, write, and except arrays to zeros
  • Do not specify MAXSOC.

For a detailed description on testing sockets, refer to SELECT.

Format

Read syntax diagramSkip visual syntax diagramEZASMITYPE=SELECTEX ,MAXSOC= address*indaddr(reg) ,ERRNO= address*indaddr(reg) ,RETCODE= address*indaddr(reg) ,TIMEOUT=address*indaddr(reg),RSNDMSK=address*indaddr(reg),RRETMSK=address*indaddr(reg),WSNDMSK=address*indaddr(reg),WRETMSK=address*indaddr(reg),ESNDMSK=address*indaddr(reg),ERETMSK=address*indaddr(reg),SELECB= ( address*indaddr(reg) ,'LIST') ,ERROR=address*indaddr(reg),TASK=address*indaddr(reg)

Parameters

MAXSOC
Input parameter. A fullword binary field specifying the largest socket descriptor number to be checked plus 1 (remember, TCP/IP for z/VSE supports socket descriptor numbers from 0 to 8191).
ERRNO
Output parameter. A fullword binary field. If RETCODE is negative, this contains an error number.
RETCODE
Output parameter. A fullword binary field.
Value
Description
>0
The number of ready sockets.
0
Either the SELECTEX time limit has expired (ECB value will be 0) or one of the caller's ECBs has been posted (ECB value will be nonzero and the caller's descriptor sets will be set to 0). The caller must initialize the ECB values to zero before issuing the SELECTEX macro.
-1
Check ERRNO.
TIMEOUT
Input parameter.

If TIMEOUT is not specified, the SELECTEX call blocks until a socket becomes ready or until a user ECB is posted.

If a TIMEOUT value is specified, TIMEOUT is the maximum interval for the SELECTEX call to wait until completion of the call. If you want SELECTEX to poll the sockets and return immediately, TIMEOUT should be specified to point to a zero-valued TIMEVAL structure.

TIMEOUT is specified in the two-word TIMEOUT as follows:
  • TIMEOUT-SECONDS, word one of TIMEOUT, is the seconds component of the time out value.
  • TIMEOUT-MICROSEC, word two of TIMEOUT, is the microseconds component of the time out value (0—999999).

For example, if you want SELECT to timeout after 3.5 seconds, set TIMEOUT-SECONDS to 3 and TIMEOUT-MICROSEC to 500000. TIMEOUT, SELECTEX returns to the calling program.

RSNDMSK
Input parameter. The bit-mask array to control checking for read interrupts. If this parameter is not specified or the specified bit-mask is zeros, the SELECT will not check for read interrupts. The length of this bit-mask array is dependent on the value in MAXSOC and must be a multiple of 4 bytes.
RRETMSK
Output parameter. The bit-mask array returned by the SELECT if RSNDMSK is specified. The length of this bit-mask array is dependent on the value in MAXSOC and must be a multiple of 4 bytes.
WSNDMSK
Input parameter. The bit-mask array to control checking for write interrupts. If this parameter is not specified or the specified bit-mask is zeros, the SELECT will not check for write interrupts. The length of this bit-mask array is dependent on the value in MAXSOC and must be a multiple of 4 bytes.
WRETMSK
Output parameter. The bit-mask array returned by the SELECT if WSNDMSK is specified. The length of this bit-mask array is dependent on the value in MAXSOC and must be a multiple of 4 bytes.
ESNDMSK
Input parameter. The bit-mask array to control checking for exception interrupts. If this parameter is not specified or the specified bit-mask is zeros, the SELECT will not check for exception interrupts. The length of this bit-mask array is dependent on the value in MAXSOC and must be a multiple of 4 bytes.
ERETMSK
Output parameter. The bit-mask array returned by the SELECT if ESNDMSK is specified. The length of this bit-mask array is dependent on the value in MAXSOC and must be a multiple of 4 bytes
SELECB
Input parameter. An ECB or list of ECB addresses which, if posted, causes completion of the SELECTEX.

If the address of an ECB address list is specified you must set the high-order bit of the last entry in the ECB list to one and you must also add the LIST keyword. The ECBs must reside in the caller's home address space.

Note: The maximum number of ECBs that can be specified in a list is 254.
ERROR
Input parameter. The location in your program to receive control, if the application programming interface (API) processing module cannot be loaded.
TASK
Input parameter. The location of the task storage area in your program.