Sign In/My Account | View Cart  
advertisement

Article:
 Very Dynamic Web Interfaces
Subject: Data the other way round
Date: 2005-04-21 11:35:17
From: nGear

This is data pulled by the client from the server.
Is there a way to push data from the server to the client?
(Without the client polling the server..)
i.e. update the client without any requests from the client itself.

Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Oldest First
  • Data the other way round
    2005-04-25 00:32:44 sunnyO5 [Reply]

    For most applications (I can think of), polling is adequate. What kind of applications do you have in mind?


  • Data the other way round
    2005-04-30 22:56:19 Mahsood [Reply]

    for example i want to have the stock market feed on my website..........

    • Data the other way round
      2005-05-03 09:55:58 sunnyO5 [Reply]

      Well, you can use polling: contact the server at regular intervals, say 1 minute, assuming some other process updates the stock information. If the server detects that there is a change (elaboration below), then it sends a new information in response; otherwise, old one stays on the user's screen.


      One way the server could detect a change is if you also send a time stamp (hidden input field could store this) when the user first browses the web page. The time stamp would have the time when the server information was last changed. So when you refresh stock information after a specified amount of interval, the time stamp is sent to the server, which compares it to the time stamp that it (server) has. If the server version is newer, then new stock is sent; else nothing.


      I haven't implemented this in practice, but this should work.


Sponsored By: