Kbase P110711: Socket timeout with SO-RCVTIMEO never happens if bytes are in the read buffer
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/11/2005 |
|
Status: Unverified
SYMPTOM(s):
Socket Timeout never happens if bytes are in the read buffer
Using the SET-SOCKET-OPTION method with argument SO-RCVTIMEO the specified timeout never actually occurs if there are still bytes in the buffer.
CAUSE:
The READ method is being used with READ-EXACT-NUM mode.
FIX:
The READ-EXACT-NUM mode is a blocking read. This causes the READ method to block until it has read the number of specified bytes.
The online help for the read method states:
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.
If the desired effect is to time out regardless of the bytes read, use the READ-AVAILABLE mode of the READ method.