Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: CGI chat room problem

by ChOas (Curate)
on Mar 12, 2002 at 13:50 UTC ( #151112=note: print w/replies, xml ) Need Help??

in reply to CGI chat room problem


I've done the same thing (build a chat, that is)...

You could do a couple of things, run a chat daemon (A
process that just runs, and gets information from your
chat script, and processes this), good thing here is that you
can have a loop in this program which just compares the
current time (as from "time()" (Seconds sinds the Epoch))
with the last time a user typed something (The way I did it
was have a hash, based on username, and that would store
amongst other things the last time a user typed something)
if the difference is bigger than, say, 5 minutes, it is
safe to delete this user from the hash as being an active user.

Another option is to have the script keep it`s state in
either a plain text file, or a database, whatever, whenever
an event occurs which calls your script (user
loging in, someone talking, whatever) it processes the file,
or database, and takes out idle users doing the same
compare I explained before.

Does this help ?


print "profeth still\n" if /bird|devil/;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://151112]
[Discipulus]: if i can suggest La Reine Margot too is a great book and obviously The Count of Monte Cristo that is a chef-d'œuvre
[Discipulus]: The red sphinx is about Rechilieu, absolutely thrilling
[erix]: thanks, Discipulus - I got them lined up at gutenberg :)
[erix]: I red the musketeers and Monte Cristo but both a very long time ago (many decades ago)
[erix]: *read
[Discipulus]: dunno if a young people can well understand the deep of Montecristo

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-05-24 07:25 GMT
Find Nodes?
    Voting Booth?