I'm working on a project which requires some sort of 'connection' between 2 (or more, actually) clients. Basically one person should be able to send data to another person with their webbrowser, somewhat comparable to a instant message system.
My first idea was using XHRs to send data to the server, and let PHP store this data in a MySQL table. Later, the other client would use an XHR to request data from the server. The server then sends back all data so the client can use it.
The fact that I'm constantly pulling data shouldn't be a big problem, but I was wondering if there is a better way to achieve this sort of communication. The data doesn't have to be stored for more than a few seconds, so the MySQL database would only function as some sort of buffer. On the other hand, there is (as far as I know) no way to directly send data to another client, but perhaps some of you could have some suggestions for me.
Thanks in advance.