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 885263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:52:58+00:00 2026-05-15T12:52:58+00:00

The common way, I think, is making a periodic ping to the server, but

  • 0

The common way, I think, is making a periodic “ping” to the server, but I don’t like how it looks too much like

"Is there anything new? - No"
"Is there anything new? - No"
"Is there anything new? - No"
"Is there anything new? - No"
"Is there anyt..."

I’ve seen another approach where client ask for news and server “retains” the request (with a sleep loop, for example) until there is anything new. That’s cool, but I’d really like to hear about another options.

  • 1 1 Answer
  • 0 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-15T12:52:59+00:00Added an answer on May 15, 2026 at 12:52 pm

    Unfortunately there isn’t really any cross browser mechanism for pushing data from the server to the browser. For example, back in 1995 Netscape released a server push technology that uses a special content type — multipart/x-mixed-replace but from what I understand IE doesn’t support it. WebSockets are a new one but support is just coming out now.

    So you’re forced to use the tools at hand, which means the client needs to ask the server if there’s any new data — polling. Polling comes in 2 varieties: polling on an interval, and long polling. When you poll on an interval you simply make a request to the server every n seconds asking for data. This is fairly chatty (pardon the pun) if there is no new data to return. This is what people think of when you say “polling.”

    The other option, long polling, is similar in that the client makes a request to the server to see if there’s new data. But in this case the server doesn’t send a response until it has something to say. In this case the client is left hanging for a response for an undetermined amount of time. When the client eventually gets its response it parses the response and immediately makes another request which will stay hanging until there’s data.

    Both of these polling approaches consume a lot of HTTP overhead, but if you want to use XHRs this is about the only way to do it.

    A word of warning about long polling: When working with long polling it’s important to ensure that all of your XHRs are running asynchronously otherwise you’ll see the browser’s UI thread lock up.


    If you’re not interested in using AJAX then you can always use the tried and testing IFRAME-that-never-finishes-loading. In this case you have an IFRAME with the chat log and another IFRAME that contains your message area. In this case the server simply never closes the connection for the IFRAME that contains the chat log. Instead, it just keeps pushing chat messages into the body.

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

Sidebar

Related Questions

i would like to implement a TimeSpanPicker , but not in the common way
Is there a standard/common way to give compiler-style error messages that point to a
Is there a common way of counting source lines of code (SLOC) in a
Is there a standard or common way in C++ to handle static strings that
Is there a common way of dealing with tags in databases? I'm thinking of
is there a common way to test complex functions with several parameters with NUnit?
I don't really know much about the internals of compiler and JIT optimizations, but
So I'm not sure if there is a better way to do this, but
What is the common way (or best practice) to optionally use JNI? E.g. I
What is the common way of dealing with the development.sqlite3 files with VCS (in

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.