Recovering Dropped Connections

You can recover a dropped connection to an AcuToWeb client running in a browser, and a dropped connection to a device..

AcuToWeb Client
When you lose the connection between the AcuToWeb client (in your browser) and AcuToWeb Gateway, and the value of the TC_QUIT_MODE configuration variable is greater than 0, the behavior is the same as with a regular client — an additional 5 minutes is added on top of the time interval configured by the TC_CHECK_ALIVE_INTERVAL configuration variable.

For more information, see TC_QUIT_MODE and TC_CHECK_ALIVE_INTERVAL.

Device
If you lose the connection to the device on which you are displaying your COBOL application, you can configure AcuToWeb to automatically attempt to reconnect.
AcuToWeb can leverage functionality within the WebSocket connection to attempt to reconnect to the AcuToWeb Gateway automatically. To enable this functionality, and configure the characteristics of the reconnection attempt, add the following options to the gateway.toml configuration file:
Option Description
MAX_RECONNECT_ATTEMPTS The maximum number of attempts made to reconnect. Unlimited if set to -1.

Recommended value: 20 - 30

RECONNECT_INTERVAL The number of milliseconds to delay (after connection has dropped) before attempting to reconnect.

Recommended value: 1000

MAX_RECONNECT_INTERVAL The time frame, in milliseconds, in which the reconnection(s) will be attempted.

Recommended value: 30000

TIMEOUT_INTERVAL The maximum time, in milliseconds, to wait for a connection to succeed before closing and retrying.

Recommended value: 200000

RECONNECT_DECAY The rate of increase of the reconnect delay. Allows reconnection attempts to back off when problems persist.

Recommended value: 1

When a connection is lost, a message box appears. This prevents you from interacting with the program until a connection is reestablished. The message box is populated with a standard Reconnection attempt in progress ... message, but you can configure the message box to contain your own message and custom image. The reconnect.css file, available from the AcuToWeb subdirectory of your Samples directory, contains some sample code that you can use to customize the message box.