4. 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
'cmpcd' is the completion code variable associated with the local socket.
'bfr' is the variable into which the data is to be placed, and can be of any type, any length.
'len' is the number of bits of data to be received. If 'len' is non-positive, no operation is performed. 'len' is of type INTEGER*4.
'time' is the length of time the subprogram is to wait for the completion of the operation.
'offset' is the bit offset from the first bit of 'bfr' at which the first bit of data is to be placed, and is of type INTEGER*4. If not specified, the 'offset' defaults to zero.
The following completion codes are possible for this operation:
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 process; 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
24, An addressing or protection exception was encountered with respect to the data buffer; the operation was suppressed
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
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 suppressed and the socket will be closed
252, the specified time limit was exceeded; the operation was initiated but not completed