You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Bezel <be...@hotmail.com> on 2007/04/07 03:21:35 UTC

Comet question about ending the event

Hello,

Here is the situation I have a question about:

1. There is a servlet that implements CometProcessor interface.
2. Like a known chat example this servlet's event method put response
objects into a static array
3. There is another thread that listens for new messages and once they
arrive - it gets correct response object from the static array and write an
output.

The question is - how do I "commit" the response right after step #3. I
don't want to wait for an event timeout to get the response done in the
browser. writer.flush() does not really ends the browser requests... 

I've tried to to do "event.close()" (by having a hashmap of events with
response refferences) objects right in the end of step #3 and it seems to be
ok, but I'm not sure if it's a right way.
Any suggestions here?
-- 
View this message in context: http://www.nabble.com/Comet-question-about-ending-the-event-tf3539457.html#a9880431
Sent from the Tomcat - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Comet question about ending the event

Posted by Quartz <qu...@yahoo.com>.
This looks like a tomcat users question, not a tomcat developers question.
Ask it there.

As for comet-like stuff, I can only warn you of all the troubles you and mostly your customers are
about to run into trying to workaround http. Proxies, firewalls and pipelining and not going to
like the idea of hanging responses (not to mention caches issues or browsers denying more than 2
connections to a server, which will end up killing parallel downloads).

Good luck...


--- Bezel <be...@hotmail.com> wrote:

> 
> Hello,
> 
> Here is the situation I have a question about:
> 
> 1. There is a servlet that implements CometProcessor interface.
> 2. Like a known chat example this servlet's event method put response
> objects into a static array
> 3. There is another thread that listens for new messages and once they
> arrive - it gets correct response object from the static array and write an
> output.
> 
> The question is - how do I "commit" the response right after step #3. I
> don't want to wait for an event timeout to get the response done in the
> browser. writer.flush() does not really ends the browser requests... 
> 
> I've tried to to do "event.close()" (by having a hashmap of events with
> response refferences) objects right in the end of step #3 and it seems to be
> ok, but I'm not sure if it's a right way.
> Any suggestions here?
> -- 
> View this message in context:
> http://www.nabble.com/Comet-question-about-ending-the-event-tf3539457.html#a9880431
> Sent from the Tomcat - Dev mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 
> 



 
____________________________________________________________________________________
We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org