5. RECEIVE
This operation causes data to be received from the foreign socket. The subprogram will wait until the reception of data is complete.
The calling sequence is as follows:
CALL @READ(cmpcd, bfr, len, time[, offset]);
where
cmpcdis the completion code variable associated with the local socket.bfris the variable into which the data is to be placed, and must be a singly dimensioned array, DECIMAL or BINARY, FIXED or FLOAT.lenis the number of bits of data to be received. Iflenis non-positive, no operation is performed.lenhas the attribute BINARY FIXED(31,0).timeis the length of time the subprogram is to wait for the completion of the operation.offsetis the bit offset from the first bit ofbfrat which the first bit of data is to be placed, and must have the attributes BINARY FIXED(31,0). If not specified,offsetdefaults to zero.
The following completion codes are possible for this operation:
| Code | Description |
|---|---|
| 0 | The operation was successful and the data has been received |
| 4 | The specified local socket is not a receive socket; the operation was suppressed |
| 8 | The specified completion code variable is not assigned to a socket; the operation was suppressed |
| 12 | A previous RECEIVE operation is in progress; the operation was suppressed |
| 16 | The connection is not fully open; the operation was suppressed |
| 20 | The foreign socket terminated the connection before completion of the RECEIVE operation; data is unpredictable |
| 36 | Either hardware at the foreign site is inoperative, or the NCP's counterpart at the foreign site does not exist or has failed |
| 44 | By operator command, all Network operations were terminated; the socket will be closed |
| 24 | An addressing or protection exception was encountered with respect to the data buffer; the operation was suppressed |
| 52 | One or more interrupts were received from the foreign socket; the operation was suppressed |
| 60 | An NCP control transmission error occurred; the operation was aborted, and the socket will be closed |
| 252 | The specified time limit was exceeded; the operation was initiated but not completed |