views:

309

answers:

2

i want to create a web chat/forum application that is google wave alike.

when one person is typing a new post or embed an image in it other persons are seeing this live.

i have read about different techniques and i feel that long polling and iframe are the most talked about.

so, which one should i use for this application and why? i've read something about that the long polling is great for long update intervals. cause if it's a chat, then it has to request new data for every keystroke..and that is like polling every second when typing. so based on this, i should use iframe so that there is only one connection all the time?

what technology is meebo/google wave using?

+1  A: 

The non iframe like technologies are collectively called Comet, and since you didn't mention any specific language you want to use could try to use CometD which has recently been released and should you support in what you want to do. Or you just dig directly into Google Wave programming since it already seems to have everything you are looking for. Personally I always found all the iFrame solutions a little iffy.

Daff
im using php. but if i use long polling, doesnt it mean that i dont have to use comet server?
weng
Yes I think you do, because keeping a HTTP connection alive for a longer period of time is not (yet) part of the standard and implementations. In PHP you would already have problems with the maximum execution time of I think 30 seconds... then your connection will be lost anyway. Google Wave is using a Java Server + GWT, too I think.
Daff
+1  A: 

Long polling sounds like a good choice for this kind of application, but you might want to consider having some kind of delay/buffer period between key stroke and server callbacks. It doesn't have to be very long (less than a second) to give a serious speed gain.

You might also want to consider using Adobe Flash as a bridge between the client side javascript and your own custom communication protocol. This offers better control and less overhead, but comes with the price of a client side plugin dependency.

Last, but not at least, you might want to consider building your application on top of Google Wave. Unless your are building a clone of Wave for the sake of building a clone, it might provide you with a lot of the infrastructure you need.

I'd hate to sound harsh, but I think you might need to dig a bit deeper into the subject, and return when you have a more tangible question.

Jørn Schou-Rode
but the question is why should i use long polling and not iframe? cause with long polling you have to request new information after every keystroke so that other users see this. but with iframe you dont have to request anything. it just get pushed out from the server through your current connection, am i right?
weng