You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2015/03/11 23:08:21 UTC

svn commit: r1666024 - /tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java

Author: markt
Date: Wed Mar 11 22:08:21 2015
New Revision: 1666024

URL: http://svn.apache.org/r1666024
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=57683
An aborted request (the only way for the client to disconnect) should not stop the example from working for future requests.

Modified:
    tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java?rev=1666024&r1=1666023&r2=1666024&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java (original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java Wed Mar 11 22:08:21 2015
@@ -72,7 +72,11 @@ public class AsyncStockServlet extends H
         Iterator<AsyncContext> it = clients.iterator();
         while (it.hasNext()) {
             AsyncContext actx = it.next();
-            writeStock(actx, stock);
+            try {
+                writeStock(actx, stock);
+            } catch (Exception e) {
+                // Ignore. The async error handling will deal with this.
+            }
         }
     }
 



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