Native Client Launcher, retries and timeoutsecs parameters not always used?

We launch our Ignition Client (Igntion Server 7.9.6 - Java 1.8.0-161)
with the clientlauncher (Ignition 7.9.6 - Windows 7.64 bits - Java 1.8.0-161)

clientlauncher.exe gateway.addr=10.11.1.4:8088 gateway.backup.addr=10.11.8.4:8088 scope=C project=DEV_L2_NORD windowmode=fullscreen screen=0 retries=2 timeoutsecs=30 -Djavaws.launchparams="start_IHMMode;start_screen" -Djavaws.launchparam.start_IHMMode=0 -Djavaws.launchparam.start_screen=0

When we stop gateway master and backup,
It seem that the parameters retries and timeoutsecs have no effect.
The client never show the “Gateway Configuration screen”.

In the doc for the retries parameter :
How many times to attempt to contact a gateway again if an error occurred during communication. The default setting of -1 cause the client launcher to try again forever until the client launcher is manually closed. A setting of 0 will cause the client launcher to abort communication after the first failure and display the Gateway Configuration screen. A setting of 1 or more will cause the client launcher to make X more attempts before aborting and showing the Gateway Configuration screen.

In the user log, retries and timeoutsecs parameters seems not to be used

INFO  [ClientLauncherFrame           ] [12:23:32,602]: Using java executable under D:\appli\start\jre
INFO  [ClientLauncherFrame           ] [12:23:32,603]: Starting Java with the following parameters:java -classpath C:\Users\lionel\.ignition\clientlauncher-data\launchclient.jar -Djavaws.sr.gateway.addr.0=10.11.1.4:8088/main -Djavaws.sr.scope=C -Djavaws.sr.launchts=1526552610752 -Djavaws.sr.main=com.inductiveautomation.factorypmi.application.runtime.ClientLaunchHook -Djavaws.sr.platform.edition= -Xms32M -Xmx4096M -XX:MaxPermSize=128m -Dsun.java2d.d3d=false -Djavaws.sr.project=DEV_L2_NORD -Djavaws.sr.screen=0 -Djavaws.launchparams=start_IHMMode;start_screen -Djavaws.launchparam.start_IHMMode=0 -Djavaws.launchparam.start_screen=0 com.inductiveautomation.ignition.client.launch.BootstrapSwingFS 

If I stop the client and restart it (with the same command), retries and timeoutsecs are used, and the “Gateway Configuration screen” is shown after 2 retry.
It seem that these parameters are used only at the client start time but not in case the client lose the communication with the gateway ???

This is a bug or an intentional behavior ??? I would like to be able to display the “Gateway Configuration screen” when the client is disconnected from the gateway…

It’s expected behavior. The native client launcher is a separate program that closes itself after the actual client is launched. The retries and timeout settings are only used when starting the native launcher.

Ok I see, is it the same for gateway.fallback.addr and fallback.project parameters ? it’s only used at the statup of the client launcher or it has an effect when the client is disconnected from the gateway ?

You are correct, those are only used on startup.

1 Like

@mgross, do you think it could be possible to write a module with the Ignition SDK (in the client scope) in order to be notified when the client lose the connection with (master and backup) gateway.
In this case, the module could perhaps force to close the cuurent client and execute a script to launch a client with another gateway.

It would be cool, but I am unaware of anything in the public API that you could hook into when a client loses its connection to the gateway.

Well, you can use the SDK to do this, even without a module. Something like this in a client startup event script (utterly untested and unsupported):

from import com.inductiveautomation.ignition.client.gateway_interface import GatewayConnectionManager
from java.beans import PropertyChangeListener

class GwCxListener(PropertyChangeListener):
    def propertyChange(self, event):
        if event.propertyName == 'connectionMode':
            if event.newValue == 3:
                # Do something on connection/reconnect
                pass
            else:
                # Do something on disconnect
                pass

GatewayConnectionManager.getInstance().addPropertyChangeListener(GwCxListener())

Based on this interface.

(I needed this for my reliable momentary pushbutton… Good luck!)

Thanks a lot @pturmel, I will test it !