ASP.NET - comet Pushing messages from the server to all clients

I am making an application with one-way server variables that change every second. Every second, this new variable should be displayed for all clients who have a web page open.

Now most people told me to go with comets because I need to push / pull data every time, now I have a few questions:

  • What would be the best solution, looking at the fact that I need new data EVERY SECOND, pulling from the client or clicking on the server?

  • The identifier of the element that is on the server side (with the variable obtained by the ID) can change, and when the client refreshes the page on which he needs to get the oldest (and live) identifiers. This would mean that my client side jquery / javascript needs to know what identifier it got on the page, what is the best way to do this?

  • The last thing I can not find a good (not expensive) comet / api library for asp.net (C #). Has anyone ever used a comet library with good results? We are looking at a site that should be able to mount 2,000 comets at any time.

+5
source share
3 answers

, , ?

, , . XMLHttpRequest , . ( ), , , , .

, ( , ID) , , ( ) ID. , jquery/javascript , , ?

, , , , / . , ; , . :

{ first_variable: 345,
  second_one: "foo",
  and_the_third: ["I", "am", "an", "array,", "hooray!"]
}

second_one, . "bar", :

{ first_variable: 345,
  second_one: "bar",
  and_the_third: ["I", "am", "an", "array,", "hooray!"]
}

, ( ) /api asp.net(#). - - ?

ASP.NET, ? , , , () ?


: , , , PHP:

<?php
  sleep(5);
?>
<b>OK!</b>

sleep , . HTML , . JSON. , ASP.NET/#.

+2

SendToAll PokeIn ASP.NET ajax library.

+5

WebSync Frozen Mountain IIS ASP.NET. node.

, .

+3

All Articles