Ok, I am working up something like a chat environment, and I'd like to have near real time if not real time conversation. But I know browsers will only give up 2 threads at a time for transactions per domain. So I am trying to figure out a way to make a synchronous chat without really effecting the browser. I also know browsers tend to lock up with synchronous requests.

So whats the best approach at creating a chat like environment on a site from scratch, assume the DB and scripting concept is fine, its the managing of the connection, wondering how to keep a persistant connection that won't congest the browser and cause it to possibly freeze up.

Anyone have any ideas.. Im not looking for flash, or java based solutions. I'd prefer not to poll every second either. But what is stacks impression, what would you do.

link|improve this question

A synchronous chat without affecting the browser? The very definition of synchronous makes that impossible. Anyway, look into web sockets, specifically Socket.IO. – minitech 4 mins ago
feedback

1 Answer

My own chat engine checks for new messages every five seconds. That's close enough to instant that nobody knows the difference.

It's as simple as setInterval(updateChat,5000);.

link
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.