Re: PHP Chat REALTIME
| From: | Bogdan Stancescu | Date: | Tue, 22 Jan 2002 13:28:36 +0000 |
| Subject: | Re: PHP Chat REALTIME | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81539@lists.php.net to get a copy of this message | ||
I've been kidding around with a chat experiment of my own a few weeks ago and
stumbled in the same problem with refresh, so I'm quite interested in this
discussion. So, ok, I didn't know about flush() at all, but how do you keep the
http connection open in the first place? Just keep looping in the PHP or is
there a smarter way?
Bogdan
Joffrey van Wageningen wrote:
> > I dont think its possible without Java programing.
>
> its posible to keep a http connection open and trust on flush() to send some
> data to the client, if this data contains javascript you could update a
> window or something... if you want to make this safe: make sure you use a
> combination of a open http connection with flush() and reload the frame your
> flush()'ing time to time (in case of a proxy server)
>
> shoplist for a chat:
> * 3 frames: 1 to display incomming data, 1 to have a input field and post to
> the server and 1 to receive data from your http stream (could be hidden)
>
> * some javascript to move the data from the http stream window to the
> display window
>
> * a db backend and maybe a check (with the post, or the refresh) which lines
> have been received by the client
>
> * a cute design :)
>
> with kind regards,
> Joffrey van Wageningen
> ne2000.nl