0

An easy and normal task is, to update our application, pull new values every n seconds.

But this starts to consume a lot of the server soon a lot of users are hooked up.

Is there a way to register that user connection and act more as a PUSH if new values exist in the server rather than every user pull new values every 1 sec for example?

So when values change in the server, the server sends them to the user and not the other way around, all we need to do if get the values on the first connection.

What could be my options on this (technology, naming (so I can search more on the web), etc)?

balexandre
  • 73,608
  • 45
  • 233
  • 342

2 Answers2

3

You could take a look at WebSocket API available in HTML5. It allows the server to push notifications to the client. And here's the corresponding Wikipedia article. You may also checkout this related sample.

Community
  • 1
  • 1
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
0

May be you need a realtime connection.The Actionscript class XMPsocket and a TCPServer is helpful for you. It`s work on most of the browsers .

Zaac
  • 13
  • 3
  • Every time values changed in the server,your model callback could push the value to the TCPServer and the server will send it to user`s browser. – Zaac Dec 22 '10 at 08:49
  • `Actionscript` ... so this is Flash right? I just looking for simple HTML / Javascript, no fancy Flash things :) – balexandre Dec 22 '10 at 08:49
  • Yes.But HTML / Javascript(but HTML 5) can`t set a realtime connection – Zaac Dec 22 '10 at 08:54
  • You must confirm your user`s browser support HTML 5 – Zaac Dec 22 '10 at 08:56
  • no problem there Zaac, it will be mainly iPhone and Android as well Mobile opera :) all using HTML5 this days. – balexandre Dec 22 '10 at 08:57