two instances of smart clients

Questions, answers, tips and ideas on Servoy Client

two instances of smart clients

Postby tgs » Thu Oct 07, 2010 7:46 pm

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
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: two instances of smart clients

Postby mboegem » Thu Oct 07, 2010 9:52 pm

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
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1749
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: two instances of smart clients

Postby tgs » Thu Oct 07, 2010 10:09 pm

Hi Marc,
mboegem wrote: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 wrote: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
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: two instances of smart clients

Postby mboegem » Thu Oct 07, 2010 11:25 pm

tgs wrote: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 wrote: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
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1749
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: two instances of smart clients

Postby pbakker » Fri Oct 08, 2010 9:37 am

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: two instances of smart clients

Postby Harjo » Fri Oct 08, 2010 9:58 am

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:
Code: Select all
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
}

Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: two instances of smart clients

Postby mboegem » Fri Oct 08, 2010 10:18 am

pbakker wrote: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...
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1749
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: two instances of smart clients

Postby pbakker » Fri Oct 08, 2010 10:26 am

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
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: two instances of smart clients

Postby tgs » Fri Oct 08, 2010 10:47 am

Harjo wrote: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
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: two instances of smart clients

Postby Harjo » Fri Oct 08, 2010 10:57 am

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 Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: two instances of smart clients

Postby mboegem » Fri Oct 08, 2010 11:53 am

Harjo wrote: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
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1749
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: two instances of smart clients

Postby tgs » Fri Oct 08, 2010 12:26 pm

mboegem wrote: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
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: two instances of smart clients

Postby mboegem » Fri Oct 08, 2010 1:35 pm

tgs wrote: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 wrote: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
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1749
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam


Return to Servoy Client

Who is online

Users browsing this forum: No registered users and 7 guests

cron