two instances of smart clients

I have a problem on some customers configured windows PC’s. Customers put the Servoy Client shortcut in the taskbar. To open the Servoy Client only a singleclick is needed, but they make sometimes a doubleclick and than two instances of a Smart Client are running on that PC. I think they do so.
Anyway, perhaps the user clicks the shortcut a second time, but the Smart Client is already open. Is there any settings/properties for blocking that? How can I set that only one Smart Client is running on a customers PC?

Regards,
Thomas

HI Thomas,

there’s a setting on the Main admin page 'servoy.allowExistingClientActivate: ’
if this is set to true, normally just one client can be opened.
Whenever a link is clicked a 2nd time, the existing client is being activated.

BUT… this setting depends on Browser cookies.
So if a user has disabled cookies or delete the cookies while the first client is running, you’ll end up having a 2nd client anyway.

Hope this helps

Hi Marc,

mboegem:
there’s a setting on the Main admin page 'servoy.allowExistingClientActivate: ’
if this is set to true, normally just one client can be opened.
Whenever a link is clicked a 2nd time, the existing client is being activated.

The setting in the servoy-admin page is ‘true’, but a 2nd Smart Client can be opened.

mboegem:
BUT… this setting depends on Browser cookies.
So if a user has disabled cookies or delete the cookies while the first client is running, you’ll end up having a 2nd client anyway.

Browser cookies? For Smart Client?
I thought the settings in the servoy-admin page are stored in the property file?

regards,
Thomas

tgs:
The setting in the servoy-admin page is ‘true’, but a 2nd Smart Client can be opened.

Seems this is not working anymore… I just tried this in v5.2.2

tgs:
Browser cookies? For Smart Client?
I thought the settings in the servoy-admin page are stored in the property file?

As we need to start our solution using a deeplink containing startup arguments, no shortcut is being saved to the desktop.
Result of this is that we have to fire a client via a url.
So this explains the cookies part a little.

Please also look here: http://forum.servoy.com/viewtopic.php?f=22&t=14310&p=75599#p75599

I think clicking the shortcut twice very shortly after each other (doubleclick basically) would be too fast for Servoy to know about the the first client’s existence when the second click occurs.

Besides that, the mechanism only works when you deeplink to a certain method, which then always goes through a browser where a cookie is set, in order to identify a certain machine.

In order for the Application Server to know which potentially already running SC to activate, the server needs to be able to link the incoming request to start/deeplink into a client with all running clients. The only way to do this is through a cookie in the browser.

Paul

what you also could do, is using the addClientInfo in combination with the getClientCountForInfo function
You can set for for instance, on your login screen startup method, the mac address of that machine.

for instance:
in your startup method you do this:

var vMacAddress = plugins.it2be_tools.Client.MACAddress
application.addClientInfo(vMacAddress);
vCount = application.getClientCountForInfo(vMacAddress)
if(vCount > 1) { //there is more than one client open with the same macaddress
    application.exit()
} else {
   ///continue here
}

pbakker:
Besides that, the mechanism only works when you deeplink to a certain method, which then always goes through a browser where a cookie is set, in order to identify a certain machine

Ah… that’s why it doesn’t seem to work anymore. I used a deeplink to a profile, which holds the information about method & arguments…

If you deeplink to a profile, the clients still get started through the browser, so in theory is could still work, I think.

If you could test if a direct deeplink does work and a deeplink through a profile doesn’t, then please register a case for that, so the engineers can have a look at that.

Paul

Harjo:
what you also could do, is using the addClientInfo in combination with the getClientCountForInfo function
You can set for for instance, on your login screen startup method, the mac address of that machine.

Hi Harjo,
your code is very cool and a good idea to solve the issue. Do I necessarily need the it2be-plugin to get the MAC address?
An alternative client info could be the IP-address and/or the user ID to avoid one user is logged in twice, right?

Regards,
Thomas

yes, using the mac address was just an example and I knew the tools plugins of IT2BE does that.
You need somekind of unique key-string for that machine…

Harjo:
You need somekind of unique key-string for that machine…

if you have some kind of user table, you can also use the pk to have a unique identifier

mboegem:
if you have some kind of user table, you can also use the pk to have a unique identifier

I have modified my onOpenSolution function by Harjo’s sample and replaced the MAC address request by the user ID. It is working well and in addition I’m able to restrict the users only logged in once (some of them are changing to an other workplace, but stay logged in on the previous) in an easy way.
Thanks for that!

Regards,
Thomas

tgs:
I have modified my onOpenSolution function by Harjo’s sample and replaced the MAC address request by the user ID. It is working well and in addition I’m able to restrict the users only logged in once (some of them are changing to an other workplace, but stay logged in on the previous) in an easy way.
Thanks for that!

Always nice to help someone out :-)
We do a similar thing at tenant level, as we count concurrent users.
We already got requests to enable users to log off previous sessions. As we need an additional plugin for that we skipped it for now, but I think especially for the tight check you use this could be a nice one to think about as well.

pbakker:
If you could test if a direct deeplink does work and a deeplink through a profile doesn’t, then please register a case for that, so the engineers can have a look at that.

Tested it: deeplink w/o profile client activation works, w/profile it doesn’t
I think this is actually kind of normal as the path call to the server really changes using a profile and the deeplink just points to the jnlp file