Specifying the timeout length
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Specifying the timeout length
Besides setting the read mode, you can also set the
amount of time READ() waits before timing out.
To do so, use the SO-RCVTIMEO option of the SET-SOCKET-OPTION() method.
If you do not set a timeout value, the default is for READ() to
wait forever.
READ()'s timeout behavior is affected by the
interaction of the read mode and the timeout value, as the following
table illustrates.
| Read mode | With a timeout value | Without a timeout value |
|---|---|---|
READ-AVAILABLE
|
Assuming there are no connection failures, READ() blocks
until one of the following occurs:
|
Assuming there are no connection failures, READ() blocks
until there is at least one byte available to read on the socket |
READ-EXACT-NUM
|
Assuming there are no connection failures:
|
Assuming there are no connection failures, READ() blocks
until there are bytes-to-read bytes available
to read on the socket |