View previous topic :: View next topic |
Author |
Message |
Kushal
Joined: 11 May 2018 Posts: 52
|
Posted: Mon Jun 04, 2018 2:01 pm Post subject: Floating License making application start up slow |
|
|
Hi,
I've just started using Floating Licenses in my application! Quite happy with it, but I've noticed that my app starts up 5 to 10 seconds SLOWER than normal!
After reverting back to a local license, it starts up as normal (about 2 second).
Server speed/network speed aren't an issue (enough free resources/gigabit network/etc).
Any way of speeding this up?
Secondly, is there a way we can 'check' how many floating licenses are being used at any given time?
Thank you. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Jun 05, 2018 11:11 am Post subject: |
|
|
I suspect this is a networking issue of some kind (possibly fire wall related) as I haven't seen similar issue before. If you run the client on the same computer as the license server does it have the same delay? If you install the license server on a different computer does this change anything?
If you want to so how many floating licenses are in available/in use then you can add methods to the LicenseServer class to return NumFloatingLicenses and _activeLicenses.Count. You client code can then call these methods (in the same way that it calls GetLicense on the remote LicenseServer object) to get the values and display them to your user. _________________ Infralution Support |
|
Back to top |
|
|
Kushal
Joined: 11 May 2018 Posts: 52
|
Posted: Wed Aug 15, 2018 8:32 am Post subject: |
|
|
Quote: | you can add methods to the LicenseServer class to return NumFloatingLicenses and _activeLicenses.Count |
I can't seem to find the _activelicenses.count function. Bit more on that please. Thnx |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Aug 15, 2018 10:32 pm Post subject: |
|
|
It's a member variable in the LicenseServer class. Declared as below:
Code: | private List<FloatingLicense> _activeLicenses = new List<FloatingLicense>();
|
_________________ Infralution Support |
|
Back to top |
|
|
Kushal
Joined: 11 May 2018 Posts: 52
|
Posted: Sat Aug 18, 2018 10:29 am Post subject: |
|
|
I can't seem to access the list of _activeLicenses.
Changed it to public as well, but keeps giving 0.
any example in the code? or please, if you can, expand on the example?
Regarding startup being slow, I found where it is slow. First thing before the app runs, the license is checked, so in;
GetFloatingLicense()
Line: result = licenseServer.GetLicense(Environment.MachineName)
This is where it takes 5 to 10 seconds. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sun Aug 19, 2018 12:28 am Post subject: |
|
|
You can't just make the property public and then access it from the client. The client process has a proxy object for the LicenseServer (which is a MarshalByRefObject) which is actually inside the server process on the server machine. I think member variables on the local proxy object will always be uninitialized - so you should not try to access these directly. Instead you should add a public property which returns the count. This should be marshaled to call the corresponding property on the server objects returning the correct value. eg
Code: | private int ActiveLicenseCount
{
get
{
return _activeLicenses.Count;
}
}
|
With regard to the speed issue. Where is your license server running? If you install the license server on the same machine as your client (which runs fine with a local license) do you have the same delay.
What are the operating systems of the client and server machines? What version of Infralution Licensing System are you using? _________________ Infralution Support |
|
Back to top |
|
|
Kushal
Joined: 11 May 2018 Posts: 52
|
Posted: Mon Aug 20, 2018 7:19 am Post subject: |
|
|
Thanks for the advice on public property.
Regarding slow floating lic startup, if installed on the same computer as the license service, then it takes 2 seconds, rather than 5 to 8 seconds on a network PC.
If I install a local license (not floating), then it's instant startup.
Versions:
License Tracker is 6.4.1.0
DLL used in app is 6.4.0.0 |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Aug 20, 2018 11:20 am Post subject: |
|
|
What are the operating systems that you are running on? This sounds like some form of strange networking issue. When running local on any machine I test on this runs near instantaneously. If you install the license and select the Floating license option how long does this take once you hit the OK button? _________________ Infralution Support |
|
Back to top |
|
|
Kushal
Joined: 11 May 2018 Posts: 52
|
Posted: Mon Aug 20, 2018 2:10 pm Post subject: |
|
|
License Tracker being run on Windows 10.
License Service, in my office, running on Win server 2016.
When pressing OK the the licensed app, on my PC (service is on another), closes INSTANTLY. no delays there. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Aug 21, 2018 3:19 am Post subject: |
|
|
When you start the program, if a floating license is selected in settings ,it will call GetFloatingLicense(serverAddress, port) which contains the line you say is taking 5 to 10 seconds to execute. When you open the license dialog it also calls this exact same method - but it executes immediately. The only difference is that the connection has been made once previously (on startup). This points to some sort of networking issue. If you configure the application as a standalone license, then restart it and switch to a floating license how long does this take when you press the OK button after selecting the server (in this case there will be no previous call to GetFloatingLicense) _________________ Infralution Support |
|
Back to top |
|
|
Kushal
Joined: 11 May 2018 Posts: 52
|
Posted: Fri Aug 24, 2018 2:19 pm Post subject: |
|
|
Seems like a windows firewall issue!!!
Thanks for helping! Sorry for the time wasting! |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sat Aug 25, 2018 12:04 am Post subject: |
|
|
No problem. I thought it had to be something like that. _________________ Infralution Support |
|
Back to top |
|
|
|