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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:29:44+00:00 2026-06-09T03:29:44+00:00

I am trying to build chat application with long polling mechanism on Google app

  • 0

I am trying to build chat application with long polling mechanism on Google app engine server.
HTTPRequest has default time out of 30 seconds, so I am sending polling request to server every 28 seconds if there is no update from server (so that I wont miss any message from other clients).
First request gets registered, but second request sent after 28 seconds is not reaching server.

function loadPage(query){
$.get({ url: query, success: function(events){
   updated = 1;
   //events data processing
   createServerChannel();
     });
}

  function createServerChannel(){
      var query='/ChatController?&user='+userName+'&sessionName='+sessionName+'&register=true';
      loadPage(query);
      updated = 0;
      setInterval(function() { poll(query); }, 28000);
   };

   function poll(query){
       if(updated==0){
          loadPage(query);
       }
   }

I am using thread.wait() for request to wait on server. Is there any way to consume first pending request when next request from same client is available.
Please help.

  • 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-06-09T03:29:47+00:00Added an answer on June 9, 2026 at 3:29 am

    I think web sockets might be a better approach as this keeps a continuous connection open to the server and waits for the server to push data to the client.

    http://www.html5rocks.com/en/tutorials/websockets/basics/

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

Sidebar

Related Questions

So long story short, im trying to build a chat application....well its already built
I'm trying build an App Engine connected Android application and am having some problems
I am trying build small webcam chat (web application). I searched on google and
I am trying to build a bluetooth chat application using j2me. I created a
I am trying to build a simple chat application using AMQP, Websockets and Ruby.
I'm trying to build an application that has two process that uses Shared memory
I'm trying to build a chat server-client program in Java. But the problem is
I was trying Build For Archiving application (from Titanium Mobile) with xCode 4.4, but
I am trying build a DataTable one row at a time using the following
i am trying to build a simple chat system but I'm not sure what

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.