I am new to Java. I am trying to write something on lines of MVC where my web server has a java method that reads a text file one row at a time every 20 milliseconds and I want to send (/push) this value to client every 20 milliseconds (that is at the same instant as the new row is read from CSV).
I have read this http://en.wikipedia.org/wiki/Comet_%28programming%29
But being very new to all this could not understand much. How push/pull/streaming works and what to use here. Moreover if I should be pulling or pushing values here. I think I should push else server will be clogged by so many pull requests every 20ms.
Please suggest. Any piece of code will be a great great help.
I am new to Java. I am trying to write something on lines of
Share
You cannot push data from Web server to client/browser as client machines firewall will block any kind of connection you try to make with machine. Browser has always need to pull it from server.
You can virtually achieve this by using reverse ajax using long lived HTTP connection from Javascript/Ajax
Please refer to following link for the example
http://today.java.net/pub/a/today/2007/03/22/developing-applications-using-reverse-ajax.html