Kbase P139994: How to trap socket time-out in ABL/4GL?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/25/2009 |
|
Status: Unverified
GOAL:
How to trap socket time-out in ABL/4GL?
GOAL:
Is it possible to determine when a socket has timed out?
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.x
FIX:
It is possible to handle a timeout in the 4GL using the SET-SOCKET-OPTION("SO-RCVTIMEO","somevalue") method.
The SO-RCVTIMEO option sets the timeout length?that is, the number of seconds the socket waits to receive data before timing out. Set arguments to the desired timeout value in seconds.
If a timeout occurs, READ( ) returns TRUE and the value of BYTES-READ is zero. This is true whether the READ( ) mode is READ-AVAILABLE or READ-EXACT-NUM.
Another option would be to implement it within the client code using the READ-RESPONSE event. The timestamp of events received should be stored and compared with the next event timestamp: if the connection is dropped and the difference of the timestamps is higher than the specified time-out, then the reason for the disconnection has been a time-out.