Posted by Jerry Stuckle on 10/02/06 16:47
Lenard Redwood wrote:
> I'd like to create a simple chat application that will leave the
> connection open for a minute and then restart the connection to the
> server to push data. I plan to use temporary .txt files to store
> messages. My question is how can I do that in PHP 5, what techniques
> should I do server-side to keep this connection open and how would be
> the flow of the message? Do I need a different technology such as
> Python to handle messages?
>
> 1. User A sends a message to the server
> 2. ?
> 3. User B receives the message instantly through an open connection
>
> Any tip/link/tutorial would be greatly appreciated.
> Thanks,
>
> Lenard.
>
You can't. HTTP is a pull only protocol. You can use javascript on the
client to pull the info on a regular basis (i.e. every 30 seconds). But
you can't push the data out.
The other alternative is something like a Java applet where you can
maintain a connection.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|