Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1023679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:39:45+00:00 2026-05-16T11:39:45+00:00

I’m making an application with server sided variables that change every second. Every second

  • 0

I’m making an application with server sided variables that change every second. Every second those new variable need to be shown at all the clients that have the webpage open.

Now most people told me to go with comet because I need to push/pull the data every second, now I’ve got a few questions:

  • What would be a better solution looking at the fact that I need the new data EVERY SECOND, pulling from the client or pushing with the server?

  • Also the item ID’s that are on the server side (with the variable’s that ID got) can change and when the client refreshes the page he needs to get the oldest (and living) ID’s. This would mean that my jquery/javascript on the client side must know which ID’s he got on the page, what is best way to do this?

  • Last thing is that I can’t find a good (not to expensive) comet library/api for asp.net (C#). Anyone ever used a comet library with good results? We’re looking at a site that should be able to have 2000 comet connections at every moment.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:39:46+00:00Added an answer on May 16, 2026 at 11:39 am

    What would be a better solution
    looking at the fact that I need the
    new data EVERY SECOND, pulling from
    the client or pushing with the server?

    I don’t think it doesn’t matter that much, as the time between requests and the time new data will be available is rather short. I would just instantiate a new XMLHttpRequest at the client after the previous one succeeded. You could send the server the last received data (if not too big) so it can compare that data with the current one available on the server and only send something back when new data is available.

    Also the item ID’s that are on the
    server side (with the variable’s that
    ID got) can change and when the client
    refreshes the page he needs to get the
    oldest (and living) ID’s. This would
    mean that my jquery/javascript on the
    client side must know which ID’s he
    got on the page, what is best way to
    do this?

    I’m not totally sure I understand what you mean, but if I’m right you can just store every name/value pair in an object. When a new variable arrives at the client, it doesn’t overwrite existing data; when a certain variable is already present, it is updated with the latest value. It could look like:

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

    and when a new state of second_one arrives, e.g. "bar", the object is updated to:

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

    Last thing is that I can’t find a good
    (not to expensive) comet library/api
    for asp.net (C#). Anyone ever used a
    comet library with good results?

    I don’t have any experience with ASP.NET, but do you need such a library for this? Can’t you just program the server-side code yourself, which, as I said, leaves the connection open and periodically (continually) compares the current state with the previous sent state?


    UPDATE: To show it’s not that difficult to keep a connection open at the server side, I’ll show you a long-polling simulation I wrote in PHP:

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

    Instead of letting the process sleep a few seconds, you can easily test for changes of the state in a loop. And instead of sending an arbitrary HTML element, you can send the data back, e.g. in JSON notation. I can’t imagine it would be that hard to do this in ASP.NET/C#.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.