Hi, We have developed a client-server application where the server needs to send asynchronous data to the client. Now since we are using Apache/PHP/MySQL, the client needs to poll the server periodically for information.
I was thinking if there was some way to get around this basic problem. I understand that this is how things are supposed to work, but it would be just great if i could PUSH data from the server to the client, using HTTP. Since HTTP is a request/response based protocol, Apache would not send any data to the client asynchronously. So what i was thinking was - If i tell the server to allow Keep-Alive connections, and increase the timeout value and max requests, I would effectively have a constant TCP connection. Now the only problem would be of sending asynchronous data to the client. Solution? Here goes - If there was some way in which i could get hold of the file descriptor(socket) that is being used by apache to write data to the client, then i could, from a PHP script also send any data to the client using the socket functions of PHP since i already have the socket with me. This would mean that the client doesnt have to poll the server for data any more... and if the connection does get closed, the client could reconnect to the server asking for another keep-alive connection. Now I know that this is probably the wrong place to put such a query - maybe the apache list would have been better. But since I'm using PHP out here, i thought i'd give it a try. Does the solution sound very outlandish? Are there any pitfalls? And finally, how do i get hold of the socket? Tx in advance, Vinod. _________________________________________________________ Click below to visit monsterindia.com and review jobs in India or Abroad http://monsterindia.rediff.com/jobs -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php