tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Biron <>
Subject Handling Comet Timeouts with CometProcessor
Date Mon, 03 Jan 2011 21:54:42 GMT

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

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");

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?

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

Much appreciated.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message