To read data from a connected TCP/IP socket, you invoke the READ( ) method on the corresponding socket object (SELF:READ( ) within the corresponding READ-RESPONSE event procedure). You can invoke this method on a connected socket at any time to read data. However, the method blocks depending on the amount of data available on the socket, the reading mode that you use, and the timeout value (set by the SO-RCVTIMEO option of the SET-SOCKET-OPTION() method).
This is the syntax of the READ( ) method:
Syntax
READ(
memptr-expression , position , bytes-to-read [ , mode] )
The READ( ) method transfers data from the socket to the specified MEMPTR variable, memptr-expression, at the byte position in the MEMPTR region specified by the INTEGER expression, position. Exactly how much data the READ( ) method blocks to read depends on:
The number of bytes specified by the INTEGERbytes-to-read
The reading mode specified by the INTEGERmode
The timeout value, set by the SO-RCVTIMEO option of the SET-SOCKET-OPTION() method