Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

Hi,

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 ?

GreetZ!,

    ChOas

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


Comment on Re: CGI chat room problem

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://151112]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-09-22 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (182 votes), past polls