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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T09:39:27+00:00 2026-05-14T09:39:27+00:00

I am trying to understand how Facebook’s chat feature receives messages without continuously poling

  • 0

I am trying to understand how Facebook’s chat feature receives messages without continuously poling the server.

Firebug shows me a single GET XmlHttpRequest continuously sitting there, waiting for a response from the server. After 5 minutes, this never timed out.

How are they preventing timeout?

An AJAX request can just sit there like that indefinitely, waiting for a response?

Can I do this with JSONRequest? I see this at json.org:

JSONRequest is designed to support
duplex connections. This permits
applications in which the server can
asynchronously initiate transmissions.
This is done by using two simultaneous
requests: one to send and the other to
receive. By using the timeout
parameter, a POST request can be left
pending until the server determines
that it has timely data to send.

Or is there another way to let an AJAX call just sit there, waiting, besides using JSONRequest?

  • 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-14T09:39:28+00:00Added an answer on May 14, 2026 at 9:39 am

    Facebook uses a technique which is now called Comet to push messages from the server to the client instead of having the client poll the server.

    There are many ways that this can be implemented, with XMLHttpRequest long polling being just one option. The principle behind this method is that the client sends an ordinary XMLHttpRequest but the server doesn’t respond until some event happens (such as another user sending a message), so the client is forced to wait. When the client receives a response (or if the request times out) the client simply creates a new request so that it always has one open request to the server.

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

Sidebar

Related Questions

I'm trying to understand how Facebook implements the chat sidebar. It seems to stay
Trying to understand something. I created a d:\svn\repository on my server. I committed folders
I'm trying to understand someone else's Perl code without knowing much Perl myself. I
I am trying to understand facebook like live notifications system to notify users, whenever
I'm trying to understand the principle behind the Facebook plugins. As I understood they
I am trying to understand, how facebook authentication works and how the flow should
I'm trying to make a Facebook Chat on Android with the Smack library. I've
I'm trying to integrate an application with Facebook Chat in C#. Facebook recommends the
Just trying to understand how to address a single character in an array of
Trying to understand an fft (Fast Fourier Transform) routine I'm using (stealing)(recycling) Input is

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.