Chat application was a nice example to start reverse ajax with DWR. For CLOCK example in dwr war used different thread from where javascript was called to update clients.
I was trying not to use separate thread where infinite loop updating clients continuously. One reason for that is when one client quits, the ServerContext.getAllScriptSessions() cannot see that. As a result, total number of clients to be updated increases, which is not desirable. May be i m doing something wrong.
I was looking for PollingServerLoadMonitor. It should check if server has some updates or not periodically. But i could not figure it out how the client request is handled in server side? Is PollHandler need to come in scene? In that case can anyone tell me how to use polling/comet where client will talk periodically to the server and at the time server will put some javascript to update client.
By the way, i m using Spring mvc in my project.
THanks in advance. |