Hello!
Active sessions counter can be implemented in your code without any
changes from Wt side. To do that, create some global counter and
increment in from constructor of WApplication's descendant class and
decrease from its destructor.
Example:
int sessions_;
class MyApplication : public WApplication {
MyApplication() {
sessions_ += 1;
if (sessions_ == 100) {
quit();
}
}
~MyApplication() {
sessions_ -= 1;
}
};
On Fri, May 18, 2012 at 3:39 PM, Stefan Ruppert <[email protected]> wrote:
> Hi,
>
> I'm currently searching for a way to limit the number of active session
> from C++ code. I found that the WebController as a sessionCount() method
> returning the current number of active sessions.
>
> But the WebController class is not available in the public interfaces.
> Therefore it would be nice to have a sessionCount() method in the
> WServer class which just returns the number of sessions found in the
> WebController.
>
> We are planning to release our web-frontend using Wt in different
> editions with different number of maximal number of active sessions.
> Therefore a configuration parameter is not suitable for us. What do you
> think?
>
> Regards,
> Stefan
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest