Consultor Eletrônico



Kbase P59184: How to implement a timeout in a 4GL socket server without TCP keep-alive
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/5/2009
Status: Verified

GOAL:

How to implement a timeout in a 4GL socket server without TCP keep-alive

GOAL:

How to implement a timeout in a 4GL socket server without the SO-KEEPALIVE option

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.1A
Progress 9.1B
Progress 9.1C

FIX:

In Progress 9.1C and earlier, TCP keep-alive is not implemented. An timeout mechanism can be implemented in 4GL using the ETIME function, as in the following example:

sending = YES.
start-etime = ETIME.
DO WHILE sending:
PROCESS EVENTS.
PAUSE 1.
IF start-etime + 60000 < ETIME THEN DO:
sending = NO.
MESSAGE "acabou" VIEW-AS ALERT-BOX.
END.
END.

Assign ETIME(yes) to start-etime to reset the time counter.