How to timeout an attempted client appserver connection.

benji00

New Member
Good Evening All,

OE10.1b running on Win32.

I am testing failsafes on an EPOS system.
EPOS client communicates last sales transaction via appserver to a backoffice suite after each sale.
This working well.

I then try when I pull the network cable out (network failure).
The CONNECT METHOD takes approximately 60 seconds before it reports failure on connect.

Is there any client parameter in order to shorten this time waiting for connect ??

Many thanks

-------------------------------------------------------------------
vconnectstring = "-H 192.168.145.189 -Appservice Aservice".

MESSAGE "Attempting To Contact Appserver on " lvhost-ip
VIEW-AS ALERT-BOX.

CREATE SERVER hServer.
MESSAGE "Created Server " hserver
VIEW-AS ALERT-BOX.

MESSAGE "Attempting to connect to appserver on " lvhost-ip
SKIP
vconnectstring
VIEW-AS ALERT-BOX.

/***********************/
vAns = hServer:CONNECT(vConnectString, "bill", ?, ?) NO-ERROR.
/***********************/

MESSAGE "Back From CONNECT " vans
VIEW-AS ALERT-BOX.
IF vAns THEN DO:
hServer=SESSION:HANDLE.
vConnected = TRUE.
MESSAGE "Appserver on host " vhost " contacted"
VIEW-AS ALERT-BOX.
END.
ELSE DO:
vConnected = FALSE.
MESSAGE "Failed To Contact Appserver On Host " vhost
SKIP
"Check on host that appserver is running using Progress Explorer Tool"
VIEW-AS ALERT-BOX.
END.
 
AFAIK there is no client startup parameter that can do something like that. This is a setting in the TCP settings of the OS. You need to look into the documentation of the OS ( Windoze in that case - the infamous regristry ) for options to timeout TCP connection attempts earlier. But you need to be aware that this timeout will affect all TCP connections, not only the one to the OpenEdge AppServer.


Heavy Regards, RealHeavyDude.
 
You could also try opening a port to the AppServer and/or some other port on the AppServer host (depending how good a job you want to do) using Windows API calls from within Progress. Those have variants that give you the flexibility to specify timeouts and so on. I think this is different from what RHD suggested, as doing so would not affect other apps.

We spent many man-months writing code that does this sort of thing, goes to a different AIA when it can't find the primary one, reestablishes connections after failures, etc. in a (I think fairly successful) attempt to work around the various weaknesses of P4GL in this respect.
 
you can ping host before connection
INPUT through (ping batch script).
repeat:
import unformatted line.
end.
input close.
 
MaximMonin

Thank you.
I already figured to do this and have introduced this.

I do still have an issue though where the appserver may be down.
In this instance I still have an unacceptable pause while client CONNECT statement tries to negotiate.

benji
 
Back
Top