You need to look at comet as a thread that sleeps. In reality it is just a http post that is taking a very very very very LONG LONG LONG LONG LONG time to get data back to the client.
This part is okay. You somehow keep the request open for really long period of time say by using Thread.sleep(x) in method which is handling the request.
That other user makes a post to the server, the server detects this post, and fires off a process on the server. That process is picked up by the "listening" Ajax call, and sent back to the client.
Here the "listening" Ajax call means the request we didn't respond (the one which is still open)?
If yes, then when you say sent back to the client, does this mean, responding the request? If yes then it'll no longer be open?
I get the point but gmail's chat doesn't seem to be doing it this way. I mean, I don't see a new ajax request goes to server when browser receives a chat response. I'll check again using FireBug but last time I checked it, if correctly, it didn't make multiple ajax calls while chatting...