Re: Advice on mod_lisp-based web application.



Blaine <Blaine.M.Nelson@xxxxxxxxx> writes:

I've got a lisp simulation program that serves its interface over
html. After
all kinds of trouble with IT folks at my organization - paperwork,
having to
migrate from Portable Allegro Serve to mod_lisp/Apache, I have a beta
version
on our intranet.

The beta works fine for one user, but, understandably, it doesn't work
for
multiple users. It's understandable because 1) multiple concurrent
users
isn't (at lease wasn't) a requirement and 2) I'm just a noob.

My kludgey and hopefully short term solution strategy is to allow only
one
user at a time. There are only a few (less than five) potential
users, so
it's not as bad a solution as it sounds.

What I was hoping for is some advice on implmentation. At the very
least, it
seems, I have two desiderata:

1. Persistence. My server needs to be able to maintain connection
with a
single, unique user while that user is using the simulation, and
politely
block other users.

and

2. Termination. After some pre-specified idle period, terminate the
"session"
(not sure what word I should be using here), thus allowing a new
user
access.

As for the Persistence issue, I was thinking I could use remote-ip-
address
key/value pair that comes with every modlisp request to identify the
user.
Will this work, or will I have to do something with cookies?

As for the termination issue, I've been tinkering around with a
timeout. One
of the options when you start a modlisp server is a timeout. When
that
timeout is reached, a timeout condition is signaled. Presumably, I
could
write code that could handle that condition, offering the user a
choice to
continue using the simulation, and in the event that the user doesn't
respond,
close out the user's "session". I'm not sure this is an appropriate
use of
the condition system, and furthermore, I don't know where I would put
the
handling code (a handler-bind form, I belive).

My guess is I have more problems than just Persistence and
Termination. Any
comments on either of these or the other problems that I'm not yet
aware will
be much appreciated.


Thanks in advance,
Blaine


PS A while back I wrote a little noob modlisp install guide that may
provide some details that may help answer my questions:
http://www.blaino.com/guide/modlisp-pcl-guide.html


I think you may need to re-think your paradigm. It seems to me that you are
approaching the problem from the wrong direction. HTTP is essentially a
"stateless" protocol rather than a stateful connected protocol. The use of
cookies etc, can simulate a stateful interaction, but its not like other more
connection oriented protocols, wehre both ends are always connected and
communicating over the same connection. While Apache and other servers to
provide some support for maintaining connections and connection pooling, this
is more related to improved performance in establishing a connection rather
than maintaining a continuous bidirectional communication channel.

You said your applicaiton would not work with more than one user. I'd
concentrate on fixing that issue. Approach the whole client/server interaction
as one which is stateless and then use cookies (or even REMOTE_USER) as a way
of connecting states and maybe have your application save/load past states of
your lisp simulation before/after dealing with a client request. This will
allow you to avoid the whole issue of trying to restrict access to a specific
user in a serial type interaction model and as a side effect, you will be able
to support multiple users at the same time (ignoring performance/resource
issues of course).

Once you assume a stateless interaction model in which you cannot know the
order or sequence of requests you will recieve, lots of problems just vanish.
Most of the time, problems I've seen people having with web based applications
are due to incorrect assumptions about the order/sequence of interactions you
will get from the same and different clients. this is an understandable mistake
because from an end user perspective, it does appear to be a well defined
sequence/series of interactions.

Tim


--
tcross (at) rapttech dot com dot au
.



Relevant Pages

  • Re: Cisco VPN client software and Windows 2000 Server
    ... have you checked the cabling from server to router? ... i've seen incorrect termination or an untapped line. ... to enable me to connect to a company VPN. ... with a "Secure VPN Connection terminated locally by the Client. ...
    (comp.dcom.sys.cisco)
  • Re: Socket write behaviour is inconsistent?
    ... I enabled network tracing and in all cases the bytes written are the ... copy 1 byte to buffer, copy many bytes to buffer, copy one byte to ... "response" buffer already includes a termination byte. ... The server isnt supposed to close the connection; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Unable to reconnect using remote desktop connection
    ... Anything in the EventLog on the Terminal Server? ... > Using Remote Desktop Connection 5.2.3790.0 to connect to Windows ... The message the client gets ... > session upon termination". ...
    (microsoft.public.win2000.termserv.clients)
  • Re: XBox 360 Media Center Network Connection
    ... no. the cable modem is the termination for the coax connection and ... I have cable ports at each of my location as well (the Media Center ... And I get my internet connection via cable. ...
    (microsoft.public.windows.mediacenter)
  • Re: OE6 does not connect with pop3 server
    ... Can we infer from this that you got a timeout on the EarthLink account ... My point about making an approximate timestamp is just to look at the ... E.g. as near as possible before the connection ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)