tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paulo Silveira <>
Subject async response being commited after flush in 7.0.x?
Date Sun, 29 Aug 2010 05:51:38 GMT

I am starting async requests inside a  asyncSupported=true servlet.
After that, sometimes an event occurs and I need to dispatch a small
message to each client. For this purpose I use a executor that will
send this message to each client in an obvious way:

	for (final AsyncContext ctx : clients) {							
		executors.execute(new Runnable() {
			public void run() {
				try {
						if (ctx.getResponse().isCommitted()) {
								System.out.println("wow! why?");
						PrintWriter writer = ctx.getResponse().getWriter();
						writer	.println(message);

						} catch (IOException e) {


After the firs message being sent for the client,
getResponse().isCommited is true. If I try to send the second message,
I will get an EOF exception.

Paulo Silveira
Caelum | Ensino e Inovação

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

View raw message