tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Handling Comet Timeouts with CometProcessor
Date Tue, 04 Jan 2011 09:15:08 GMT
On 03/01/2011 21:54, Joe Biron wrote:
> Hello,
> 
> I've been making great progress with CometProcessor on Tomcat 6.0.29.
> I have a question about handling timeouts (and I did review this
> thread: http://www.mail-archive.com/users@tomcat.apache.org/msg55616.html).
> 
> I want my clients to connect and stay connected for a very long time,
> but I do need to have my server time the connections out periodically.
> 
> When I request.setAttribute("org.apache.tomcat.comet.timeout",
> timeout), I do indeed receive a CometEvent.EventType.ERROR, but I can
> find no way to gracefully tell the client that everything is OK and I
> just want them to back off for a while then reconnect.
> 
> When I do this:
> 
> ...
> response.sendError(HttpServletResponse.SC_REQUEST_TIMEOUT, "Timed out.
> Please reconnect");
> response.flushBuffer();
> event.close();
> ...
> 
> the client does not receive the response. They only sense an
> unceremonious connection close - which, if through routers, may take
> quite some time to be detected.
> 
> How can I hook into the timeout to send the client a short response
> before connection close?

I don't believe (Filip or someone else who knows Comet much better than
I do will correct me if I am wrong) the Comet API supports that.

> Is there a better way to do this? Should my application handle these
> timeouts, and use the comet.timeout as a longer safety net?

That sounds like the way to do it to me.

Mark

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


Mime
View raw message