READV

The READV macro reads data on a socket and stores it in a set of buffers. If a datagram packet is too long to fit in the supplied buffer, datagram sockets discard extra bytes.

The following requirements apply to this call:
Read syntax diagramSkip visual syntax diagram
>>-EZASMI--TYPE=READV--,S--=--+-number---+---------------------->
                              +-address--+   
                              +-*indaddr-+   
                              '-(reg)----'   

>--,IOV--=--+-address--+--,IOVCNT--=--+-address--+-------------->
            +-*indaddr-+              +-*indaddr-+   
            '-(reg)----'              '-(reg)----'   

>--,ERRNO--=--+-address--+--,RETCODE--=--+-address--+----------->
              +-*indaddr-+               +-*indaddr-+   
              '-(reg)----'               '-(reg)----'   

>--+---------------------------+--+-------------------------+--->
   +-,ECB--=--+-address--+-----+  '-,ERROR--=--+-address--+-'   
   |          +-*indaddr-+     |               +-*indaddr-+     
   |          '-(reg)----'     |               '-(reg)----'     
   '-,REQAREA--=--+-address--+-'                                
                  +-*indaddr-+                                  
                  '-(reg)----'                                  

>--+------------------------+----------------------------------><
   '-,TASK--=--+-address--+-'   
               +-*indaddr-+     
               '-(reg)----'     

Keyword
Description
S
Input parameter. A value or the address of a halfword binary number specifying the descriptor of the socket into which the data is to be read.
IOV
An array of three fullword structures with the number of structures equal to the value in IOVCNT and the format of the structures as follows:
Fullword 1
Input parameter. A buffer to be filled by the completion of the call.
Fullword 2
Input parameter. The ALET for this buffer. If the buffer is in the primary address space, this should be zeros.

If a nonzero ALET is specified, the ALET must represent a valid entry in the dispatchable unit access list (DU-AL) for the task issuing this call. Note that ALETs can be specified only for synchronous socket calls (for example, ECB/REQAREA cannot be specified). An exception to this is an ALET representing a SCOPE=COMMON data space.

Fullword 3
Input parameter. The length of the data buffer referred to in Fullword 1.
IOVCNT
Input parameter. A fullword binary field specifying the number of data buffers provided for this call. The limit is 120.
ERRNO
Output parameter. A fullword binary field. If RETCODE is negative, this contains an error number.
RETCODE
A fullword binary field that returns one of the following values:
Value
Description
0
A 0 return code indicates that the connection is closed and no data is available.
>0
A positive value indicates the number of bytes copied into the buffer.
-1
Check ERRNO for an error code.
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.