Obviously, you can’t push data to a web application, as HTTP works in a request-response cycle.
But what hacks/methods do you know of that can imitate pushing data to a client?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use what is known as Comet:
http://en.wikipedia.org/wiki/Comet_(programming), https://stackoverflow.com/search?q=comet
Basically, javascript in the browser makes a request to the server right away (using XmlHttpRequest). The server does not respond until it has some data to serve.
From the article:
The browser makes an asynchronous request of the server, which may wait for data to be available before responding. The response can contain encoded data (typically XML or JSON) or javascript to be executed by the client. At the end of the processing of the response, the browser creates and sends another XHR, to await the next event. Thus the browser always keeps a request outstanding with the server, to be answered as each event occurs.