Hello Everyone,
I have made a browser based chat client using Ajax and MySQL. I will in short explain how is it done:
Suppose we have user A and user B. Now browser of both A and B keep pinging my server for new message. If a new message is found in the database tables, it is taken back and displayed.
But my question is, that in a scalable issue, this system will fail. Mainly because of continuous ajax request which client browser will make every n seconds (1-5 seconds).
I tried and looked at how Gmail and Facebook browser based browsers work. I dont see any continous request for new messages from the client to server thr. All i see is, if user A sends a message, it is sent to server via ajax and if it is intended for user B, it is sent to user B. (without waiting for any message request by user B)
Now i don't understand how a one sided connection is established between server and user B where server is sending a data to user B without user B requesting for it.
Any suggestions, web pointers, documents etc will be really helpful.
Imoracle
I have made a browser based chat client using Ajax and MySQL. I will in short explain how is it done:
Suppose we have user A and user B. Now browser of both A and B keep pinging my server for new message. If a new message is found in the database tables, it is taken back and displayed.
But my question is, that in a scalable issue, this system will fail. Mainly because of continuous ajax request which client browser will make every n seconds (1-5 seconds).
I tried and looked at how Gmail and Facebook browser based browsers work. I dont see any continous request for new messages from the client to server thr. All i see is, if user A sends a message, it is sent to server via ajax and if it is intended for user B, it is sent to user B. (without waiting for any message request by user B)
Now i don't understand how a one sided connection is established between server and user B where server is sending a data to user B without user B requesting for it.
Any suggestions, web pointers, documents etc will be really helpful.
Imoracle