Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to control total of users?
Message
From
12/11/2022 06:38:12
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01685303
Message ID:
01685308
Views:
46
Thank you Dmitry

>>Hello all,
>>
>>My application is available as a remote desktop application.
>>
>>I want to control the number of users that can use it simultaneously. For example let's say that I paid for 3 licenses. Let's also say company1 can connect using two licenses and company2 can only use 1 license.
>>
>>So in the end I don't want company2 to be able to use two licenses.
>>
>>I have old code that was created by Craig Berntson that was supposed to do that.
>>
>>What would you suggest? My development computer uses Windows 11 and the public cloud computer runs Windows Server 2016.
>>
>>Thanks in advance.
>
>I would use a method of semaphore files. For example, if a company has 3 licenses, I would create and lock files (using fcreate()):
>user001.log
>user002.log
>User003.log
>And leave these files locked for the entire application use. When a user leaves the application, unlock and delete this user's file (e.g. user002.log). Even if they do not unlock the file, it will be unlocked by the OS (I think after a brief time).
>So, when a new user enters the application, the code should check if all file can be locked again. If none, they cannot use the application. If any file (e.g. user001.log) can be locked, a new user will lock this file and continue on.
>I think you get the idea.
>
>HTH
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform