This read statement is a blocking read. If mode is READ-EXACT-NUM, this method returns when it has either read the requested number of bytes from the socket or an error occurs. If
mode is READ-AVAILABLE, this method returns when it has read as many bytes as are currently available on the socket, up to the requested number of bytes, or an error occurs.
This method expects buffer to identify a MEMPTR variable which already has a region of memory associated with it. The developer must call the SET-SIZE statement to allocate memory and associate it with a MEMPTR variable. It is the responsibility of the developer to free this memory, also via the SET-SIZE statement. The READ method will fail if the size of
buffer is less than
bytes-to-read.