Groups > dBase > dBase Internet > Re: Quit plusrun on web server




Quit plusrun on web server

Quit plusrun on web server
Sun, 06 Jan 2008 04:54:04 -050
Just learning how to build a plus web app, and have an important question.  

If a user submits or cancels an html form, I can quit out of the dbase runtime. 
But what if the user just walks away or just closes the browser?

How do you ensure the runtime is no longer running on the server if the user
just closes their browser?

Thanks for your help on this,
Mark
Post Reply
Re: Quit plusrun on web server
Sun, 06 Jan 2008 06:50:00 -050
Mark wrote:
> Just learning how to build a plus web app, and have an important question. 

> 
> If a user submits or cancels an html form, I can quit out of the dbase
runtime.  But what if the user just walks away or just closes the browser?
> 
> How do you ensure the runtime is no longer running on the server if the
user just closes their browser?

Mark,

CGI web apps are not persistent. They normally run for only a second or two. The

basic structure is this: a user sends a request to a web server and that server

executes the dBASE app. The app does as it is required and returns an html 
response page to the web server. The web app terminates at this point; databases

are closed; runtime is shutdown. By the time the remote user receives the html

Post Reply
Re: Quit plusrun on web server
Sun, 06 Jan 2008 17:53:35 -050
Michael,

I see.  That creates another issue for me, tho.

My desktop app is licensed per concurrent user.  I would like to do same with a
web component I will offer that will run on my client's Intranet.  This means if
only 10 concurrent users can access the app, I need to send a message to the
11th user regarding the lincense.  

Of course, if the user clicks submit or quit, I can know that user has been
freed up.  If a user just closes their browser, I cannot. 

Any ideas on how I might handle the user counts reliably, or must I throw out my
concurrent licensing for the web component?

Thanks again,
Mark

Michael Nuwer Wrote:

> Mark wrote:
> > Just learning how to build a plus web app, and have an important
question.  
> > 
> > If a user submits or cancels an html form, I can quit out of the dbase
runtime.  But what if the user just walks away or just closes the browser?
> > 
> > How do you ensure the runtime is no longer running on the server if
the user just closes their browser?
> 
> Mark,
> 
> CGI web apps are not persistent. They normally run for only a second or
two. The 
> basic structure is this: a user sends a request to a web server and that
server 
> executes the dBASE app. The app does as it is required and returns an html

> response page to the web server. The web app terminates at this point;
databases 
> are closed; runtime is shutdown. By the time the remote user receives the
html 
> page the app is no longer running.
Post Reply
Re: Quit plusrun on web server
Sun, 06 Jan 2008 19:32:22 -050
Mark wrote:
> Michael,
> 
> I see.  That creates another issue for me, tho.
> 
> My desktop app is licensed per concurrent user.  I would like to do same
with a web component I will offer that will run on my client's Intranet.  This
means if only 10 concurrent users can access the app, I need to send a message
to the 11th user regarding the lincense.  
> 
> Of course, if the user clicks submit or quit, I can know that user has been
freed up.  If a user just closes their browser, I cannot. 

Buy the time your user is able to click "quit" your web app will have
already 
terminated.

How do you propose to measure concurrent users? If you really mean the number of

instances of your app that are in the server's memory, then this should work:

#define BDE_CLIENTSLIMIT 10

if not UnderBDEClientsLimit( BDE_CLIENTSLIMIT )
    // return an over limit message
    QUIT
endif

function UnderBDEClientsLimit( nLimit )
    local bIsUnder
    bIsUnder = true
    try
       s = replicate(chr(0), 7)
       extern CINT DbiGetSysInfo(CPTR) Idapi32
       DbiGetSysInfo( s )
       bIsUnder := ( s.getByte(6) < nLimit )
    catch (exception e)
    endtry
    return bIsUnder


But 100 unique users could be using the program within a thirty second interval
if 
10 unique requests are made every three 3 seconds.

> 
> Any ideas on how I might handle the user counts reliably, or must I throw
out my concurrent licensing for the web component?

Alternatives to concurrent licensing would be licensing per server or licensing
by 
IP address.


What kind of usage are you expecting from your clients?  dBASE web apps cannot 
handle heavy usage. The BDE is limited to 48 simultaneous clients and most
servers 
will likely run out of resources at 30 or 35 clients. Remember it is the web 
server (not the client) that runs the app, and thereby runs multiple instances
of 
the BDE. But these instances only run for a second or two.

Post Reply
Re: Quit plusrun on web server
Sun, 6 Jan 2008 21:14:12 -0500
In article <JBxz3bLUIHA.1952@news-server>, NOSPAM@NOSPAM.com says...
> Michael,
> 
> I see.  That creates another issue for me, tho.
> 
> My desktop app is licensed per concurrent user.  I would like to do same
with a web component I will offer that will run on my client's Intranet.  This
means if only 10 concurrent users can access the app, I need to send a 
message to the 11th user regarding the lincense.  
> 
> Of course, if the user clicks submit or quit, I can know that user has been
freed up.  If a user just closes their browser, I cannot. 
> 
> Any ideas on how I might handle the user counts reliably, or must I throw
out my concurrent licensing for the web component?
> 
> Thanks again,
> Mark



Mark,

It will take some work, but you could have people "Login" on the first

page of your web site and keep track of when they logged in and their 
last interaction. If they have been inactive for, say, an hour, you 
could considered them "logged out" and oblige them to login again if 
they want to continue. Thus you would track the number of people 
simultaneously logged in.

I'm no web expert, but I think there is a lot of work involved in this 
suggestion so you may wish to think about it before undertaking it.

-- 
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.|        dBASE info at http://geocities.com/geoff_wass       |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
Post Reply
<< Previous 1 2 3 Next >>
( Page 1 of 3 )
about | contact