Recovering Dropped Connections

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.conf configuration file:

Option Description
MAX_RECONNECT_ATTEMPTS The maximum number of attempts made to reconnect. Unlimited if set to null.

Recommended value: 1

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

Whilst the connection is lost, a message box is displayed over the web page to prevent 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 sub-directory of your Samples directory, contains some sample code that you can use to customize the message box.