[zorp] Session limit
Balazs Scheidler
bazsi@balabit.hu
Tue, 19 Dec 2000 14:06:29 +0100
> I use zorp 0.6 and I need to limit the number of concurrent access to a
> network resource. How can I configure it with a plug or a http proxy.
for now (0.6) you should use the startUp() and shutDown() methods of your
proxy class. in startUp() increment a global variable, in shutDown()
decrement it. here's an example:
myftpsessions = 0
class MyFtp:
...
def startUp(self):
global myftpsessions
myftpsessions = myftpsessions + 1
if myftpsessions > 2:
self.destroy()
def shutDown(self):
global myftpsessions
myftpsessions = myftpsessions - 1
--
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
url: http://www.balabit.hu/pgpkey.txt