Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement floating licenses in ASP.NET? [closed]

What would be a good way to restrict an ASP.NET web application to only serve a given ammount of concurrent users?

Some requirements are:

  • Application requires login (no need to worry about anonymous users).
  • Multiple servers support (farm / load balancing).
  • An active user can be considered to be the same as an active session (not signed off or expired).
  • Additional logins must be denied if the maximum number of concurrent users has been reached.
  • Accountability is needed (administrators should be able to see who the active users are).
  • Minimum overhead on each web request (especially avoiding costly trips to a database on each request).
  • Total number of concurrent users should be kept correct even if a web server hangs, disconnects from network or has to be restarted.
  • Additional servers are available to host services (e.g. application servers).
like image 964
Fernando Correia Avatar asked Nov 06 '22 06:11

Fernando Correia


1 Answers

You could use a global variable (static) and hook up the logic in your Application_OnStart, Application_BeginRequest, or Page_Load events. Check out this for more an example: http://dotnetperls.com/global-variables-aspnet

like image 73
SRM Avatar answered Nov 09 '22 10:11

SRM