Reading data on a socket
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Reading data on a socket
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 or method). 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
|
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-RCVTIMEOoption of theSET-SOCKET-OPTION()method