ASP Instant Messaging, Part 2By Ryan S.
In Part 1 we discussed some of the basic theory behind messaging. In this part, we will look at the client code. First, let us define our initial functions for getting info outta the application variable, and then displaying it on the client.
Now, I do the
.Delete on the
aChatDB because the sender
already has it in
cChatDB, so once the recipient has it in their
cChatDB, it is
redundant, so eliminating it from the server reduces the memory load of the
application variable. (While I recognize at this point it now exists in two
separate memory addresses in regards to the two
cChatDBs, or potentially
more if you opt for a variant of this, to be discussed later in the article,
but, each of those optimally ends in 5 minutes, whereas the application
variable is much trickier to clean up if left in this state.)
Next, we need to have code to send messages.
If you notice, I have to lock and unlock the Application variable, because I have no clue if another user is perhaps filtering on it, thus corrupting the data. Clearly then, it is obvious why this fails in larger scales.
In Part 3 we will look at how to display the ASP messages!