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

  • Home
  • SEARCH
  • 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 925309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:29:57+00:00 2026-05-15T19:29:57+00:00

Current Project Setup I’ve been working on a web-based chat, similar to Facebook chat.

  • 0

Current Project Setup

I’ve been working on a web-based chat, similar to Facebook chat. At the current state, I listen for incoming chats and check for new messages in an existing chat is by doing…

setTimeout(function() { listenForIncomingChat() }, 500);
setTimeout(function() { checkForIncomingMessages( ...params... ) }, 500);

… so doing the setTimeout() makes sure these functions are always running. Depending on how many chat windows I have open, Firebug’s console can go crazy with POSTs to the server 🙂

Obviously this is really inefficient, but it is the only way I could get things to work. Now I’m looking for the ways to make it better, to do it correctly!

Some Research

Now, I have heard about Comet Programming and that this is the way to open a long-lived HTTP connection with the server, but I’m not familiar with the technology or the ideas behind Comet. WebSockets for HTML5 is probably even better, but since that is not in full swing nor is it supported by all browsers, I’ll stick with what works.

According to Wikipedia, there are several ways to develop with the Comet style: Streaming (hidden iFrame, XMLHttpRequest) or AJAX with long polling (XMLHttpRequest, Script tag). However, I don’t know anything about this. I’ve also read about the AJAX Push Engine (APE) and it looks cool, but I don’t want to use a third-party for the time being.

I’ve recently stumbled upon WebChat 2.0 so I’m going to be looking through the source code to try and understand how it all works.

On to the question(s)

So where can I find example code/tutorials on how to get started with this kind of project? How would I implement the Comet technique? How do I set up the long-lived HTTP connection with the server?

  • 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-15T19:29:58+00:00Added an answer on May 15, 2026 at 7:29 pm

    Here’s an example of a chatroom using node.js, source code here.

    I believe the client uses polling, but this example is interesting because the server side is in JS too, and node.js is efficient for this type of stuff.

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

Sidebar

Related Questions

I'm trying to setup the tab keyboard control options on my current WPF project
I have an Web Setup Project Installer and I would like to default the
I've got a web setup project with a custom screen in it that asks
In my current project, I'm producing weekly releases. I've been using the technique described
So i'm working with CakePHP v1.2.5. On my current project, I decided to start
For my current side project, which is a modular web management system (which could
Our current project at work is a new MVC web site that will use
For a current project i need to setup a specific view to display a
I'm working on transitioning my current project of about 20 developers to a modern
Our current MVC project is set up to have ViewModels that encapsulate the data

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.