AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) limiting number of instances in Windows terminal server
Thema durchsuchen
Ansicht
Themen-Optionen

limiting number of instances in Windows terminal server

Ein Thema von imadam · begonnen am 4. Jun 2019 · letzter Beitrag vom 5. Jun 2019
Antwort Antwort
Seite 3 von 3     123   
imadam

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

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 10:24
Did you try TJvAppInstances already? It is designed for limiting app instances, and it allows to set the maximum number of simultaneous instances using the property MaxInstances. I am not soure however if it is also suited for a TS.
No, I haven't tested it. Will review. But on initial aim, this won't help.
  Mit Zitat antworten Zitat
Schokohase
(Gast)

n/a Beiträge
 
#22

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 10:28
TJvAppInstances will limit the applications inside the SESSION.

So => yes, this will work on TS too.

But, a single user can open more than one session on a TS (you can limit it optional to only one session per user).
  Mit Zitat antworten Zitat
imadam

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

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 10:30
TJvAppInstances will limit the applications inside the SESSION.

So => yes, this will work on TS too.

But, a single user can open more than one session on a TS (you can limit it optional to only one session per user).
Have you tried it already?
  Mit Zitat antworten Zitat
peterbelow

Registriert seit: 12. Jan 2019
Ort: Hessen
700 Beiträge
 
Delphi 12 Athens
 
#24

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 11:40
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.
Peter Below
  Mit Zitat antworten Zitat
Schokohase
(Gast)

n/a Beiträge
 
#25

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 12:14
TJvAppInstances will limit the applications inside the SESSION.

So => yes, this will work on TS too.

But, a single user can open more than one session on a TS (you can limit it optional to only one session per user).
Have you tried it already?
I do not need to try - I saw the source code and I saw how it is implemented and working
  Mit Zitat antworten Zitat
imadam

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

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 12:30
TJvAppInstances will limit the applications inside the SESSION.

So => yes, this will work on TS too.

But, a single user can open more than one session on a TS (you can limit it optional to only one session per user).
Have you tried it already?
I do not need to try - I saw the source code and I saw how it is implemented and working
Ok . Thank you.
  Mit Zitat antworten Zitat
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
Antwort Antwort
Seite 3 von 3     123   

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:02 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz