If the time in the TIMEOUT parameter elapses before an
event is detected, the SELECT call returns and RETCODE is set to 0.
>>-EZASMI--TYPE=SELECT--,MAXSOC--=--+-address--+---------------->
+-*indaddr-+
'-(reg)----'
>--,ERRNO--=--+-address--+--,RETCODE--=--+-address--+----------->
+-*indaddr-+ +-*indaddr-+
'-(reg)----' '-(reg)----'
>--+---------------------------+-------------------------------->
'-,TIMEOUT--=--+-address--+-'
+-*indaddr-+
'-(reg)----'
>--+------------------------------------------------------+----->
'-,RSNDMSK--=--+-address--+--,RRETMSK--=--+-address--+-'
+-*indaddr-+ +-*indaddr-+
'-(reg)----' '-(reg)----'
>--+------------------------------------------------------+----->
'-,WSNDMSK--=--+-address--+--,WRETMSK--=--+-address--+-'
+-*indaddr-+ +-*indaddr-+
'-(reg)----' '-(reg)----'
>--+------------------------------------------------------+----->
'-,ESNDMSK--=--+-address--+--,ERETMSK--=--+-address--+-'
+-*indaddr-+ +-*indaddr-+
'-(reg)----' '-(reg)----'
>--+---------------------------+--+-------------------------+--->
+-,ECB--=--+-address--+-----+ '-,ERROR--=--+-address--+-'
| +-*indaddr-+ | +-*indaddr-+
| '-(reg)----' | '-(reg)----'
'-,REQAREA--=--+-address--+-'
+-*indaddr-+
'-(reg)----'
>--+------------------------+----------------------------------><
'-,TASK--=--+-address--+-'
+-*indaddr-+
'-(reg)----'
- Keyword
- Description
- MAXSOC
- Input parameter. A fullword binary
field that specifies the largest socket descriptor value being checked.
The SELECT call tests only bits that are in the range 0 through the
MAXSOC value minus 1. For example, if you set the MAXSOC value to
50, the range is 0 – 49.
- ERRNO
- Output parameter. A fullword binary
field. If RETCODE is negative, ERRNO contains a valid error number. Otherwise, ignore ERRNO.
See Socket call error return codes for information about ERRNO return
codes.
- RETCODE
- Output parameter. A fullword binary
field that returns one of the following values:
- Value
- Description
- >0
- Indicates the number of ready sockets in the three return masks.
Note: If the number of ready sockets is greater than 65535, only 65535
is reported.
- =0
- Indicates that the SELECT time limit has expired.
- -1
- Check ERRNO for an error code.
- TIMEOUT
- Input parameter.
If TIMEOUT is not
specified, the SELECT call blocks until a socket becomes ready.
If TIMEOUT is specified, TIMEOUT is the maximum interval for the SELECT call
to wait until completion of the call. If you want SELECT to poll the
sockets and return immediately, TIMEOUT should
be specified to point to a 0-valued TIMEVAL structure.
TIMEOUT is specified in the two-word
TIMEOUTas follows:
- TIMEOUT-SECONDS, word one of TIMEOUT, is the seconds component of the timeout value.
- TIMEOUT-MICROSEC, word two of TIMEOUT, is the microseconds component of the timeout 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.
For APITYPE=3 with an ECB specified, the SELECT call will return
immediately because it is asynchronous; the ECB will be POSTed when
the timer pops.
- 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 does 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. See Selecting requests in a concurrent server program for more information.
- 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. See Selecting requests in a concurrent server program for more information.
- 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 does 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. See Selecting requests in a concurrent server program for more information.
- 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. See Selecting requests in a concurrent server program for more information.
- 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 does 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. See Selecting requests in a concurrent server program for more information.
- 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. See Selecting requests in a concurrent server program for more information.
- ECB or REQAREA
- Input parameter. This parameter is required if you are
using APITYPE=3. It points to a 104-byte field containing:
- For ECB
- A 4-byte ECB posted by TCP/IP when the
macro completes.
- For REQAREA
- A 4-byte user token (set by you) that is presented to your exit
when the response to this function request is complete.
- For ECB/REQAREA
- The last 100 bytes is a storage field used by the interface to
save the state information.
Note: This storage must not be modified until the
macro function has completed and the ECB has been posted, or the asynchronous exit has been driven.
- ERROR
- Input parameter. The location in your program to receive
control when the application programming interface (API) processing
module cannot be loaded.
- TASK
- Input parameter. The location of the task storage area in your
program.