Einzelnen Beitrag anzeigen

imadam

Registriert seit: 4. Jun 2019
12 Beiträge
 
#27

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 12:59
Hello,
I can read a little of German, but to write, not possible. So here is my question in English:
I have Delphi app which need to execute in Windows Terminal Server (nowdays RDS). We would like to be able to control how many instances user can run in their session. So for example:
- user 1 can run two instances of app 1
- user 2 can run 1 instance of app 1

We are able to fix this on Windows to have only one instance of application running but on TS is a bit problem for us. Anybody had similar problem?

Thank you.
This is the classical scenario for a licence server. You have a separate process (Windows or web service) running on a known platform. This process accesses a repository of licenses assigned to specific users. This can be a simple file. When your program is started it identifies the current user (Windows GetUsername API function) and then asks the licence server whether there is a free licence for that user available. If not it exits with a suitably ascerbic error message. If a licence is available it claims it from the server, usually giving the server a combination of computer name or ip address and process ID as a means to identify the claimer of the licence for the licence admin. When the application ends it returns the licence to the server.

The main problem in this scenario is how to deal with unexpected termination of the program holding the licence. In this case the licence is not properly returned to the server for later reuse. How to handle that depends on specifics of the environment. You can, for example, implement a mechanism that allows the server to check at intervals whether the processes having a licence in use are still running. Or you can require the program to regularly "renew" the claim they have on a licence, e.g. at 10 minute intervals. The licence is then reset to available if two of these intervals have passed without a renewal of the licence.
You can look at it from that point. And it is good point. However, here main reason is to prevent users hogging RDS server since they open multiple application to use (it is easier for them) and if you have 100 users opening up same up 3-4 times, then it is like 400 users on server which should support 100 users
  Mit Zitat antworten Zitat