Andre_br has asked for the wisdom of the Perl Monks concerning the following question:

Hello my friends,

I want to set up a chatroom, but, if the data manipulation doesnīt seem to be a problem using mysql, as I plan to, the refresh for the message frame is. I am not sure of how to do it.

I know thereīs the obssessive approach - wich is telling this frameīs cgi-generated html to refresh every n seconds. But I would like to get the page to refresh only when some new message has been sent my some user.

Is this server push?

Also, Iīm completely lost regarding how the script scheme should be?

Can you guys give me some directions? I really donīt want to use ready-made scripts.

Thanks a lot

Andre_br

Replies are listed 'Best First'.
Re: Chat room receipt
by ikegami (Patriarch) on Apr 27, 2005 at 19:22 UTC

    Yes, that is the very definition of server push.

    This page describes how to do server push.

    Keep in mind that server push keeps a server connection busy, and that you have a limited number of server processes. It's usually better to use a slim HTTP deamon designed specially to push, or to not use HTTP at all.

    I really don't want to use ready-made scripts.

    Doesn't that prevent us from giving you any code?

      Hey,

      I meant I donīt want to use ready-made scripts in this chat issue only. And, I said that because the ones I looked into had incredibly dirty code. Sorry if I made it look way too generalized. If you have some code, I would definatelly apreciate.

      I didnīt understand what you meant by slim HTTP deamon .

      Maybe better go obssessive... What do you guys think?

      Thanks

      Andre_br

        By a slim HTTP deamon, I meant one that doesn't take multiple megabytes of memory per client connection. For example, a slim HTTP deamon could be a Perl script using written to handle many clients simultaneously using select or threads.
Re: Chat room receipt
by holli (Abbot) on Apr 27, 2005 at 19:22 UTC
    I really donīt want to use ready-made scripts.
    Why? Aren't you lazy?


    holli, /regexed monk/