I can’t tell you what is best used in your case, not knowing your case in detail.
In most cases, it is enough for clients to check with the server every one or two seconds, asking if something new has happened. I prefer this over sockets most of the time because it runs on every web server without any configuration changes and in any browser that supports AJAX, even the old ones.
If you have few clients (because each client requires an open socket on the server) and you want real-time, you can use websockets. There are several PHP implementations, for example: http://code.google.com/p/phpwebsocket/
source
share