Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 624BC47B5 for ; Fri, 10 Jun 2011 13:12:06 +0000 (UTC) Received: (qmail 16672 invoked by uid 500); 10 Jun 2011 13:12:02 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 16475 invoked by uid 500); 10 Jun 2011 13:12:02 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 16466 invoked by uid 99); 10 Jun 2011 13:12:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2011 13:12:02 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.138.91.19] (HELO nm3-vm2.bullet.mail.ne1.yahoo.com) (98.138.91.19) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 10 Jun 2011 13:11:53 +0000 Received: from [98.138.90.53] by nm3.bullet.mail.ne1.yahoo.com with NNFMP; 10 Jun 2011 13:11:32 -0000 Received: from [98.138.89.172] by tm6.bullet.mail.ne1.yahoo.com with NNFMP; 10 Jun 2011 13:11:32 -0000 Received: from [127.0.0.1] by omp1028.mail.ne1.yahoo.com with NNFMP; 10 Jun 2011 13:11:32 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 681681.73565.bm@omp1028.mail.ne1.yahoo.com Received: (qmail 4634 invoked by uid 60001); 10 Jun 2011 13:11:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1307711492; bh=WSdo8lWZjk7brUaeLnRnoHITAOyGpFB+tDlL8047vyo=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=yzQ/JotyjMA4BUGNKSnbMVPpvv/kjO0RmAmfhzbgS/B2t7k8/A49KAiu00ZjyXgmJJkbc0Z9IFItDBGRKy25xgG/oy1vz46ed6ZmObrdbG6/xI9Y0kie6/NYaD7LRusX1KRP9jUGoy6glqrLP+cVf4bjl4hYs3P+G9hKuexXgQg= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=DxUmNXAAewK58WUj8T1dmTxniWDdVfXey8mDw+CWXbv5wa4yyHECDm9/5Xo1gf56wvLiPv+ELrlzzqlwu0BpVEZGo03uePR1VZXMW1nAmvMlNB8sLc0rTJLhH1gQfNDxUztEYnvWvoe2fvcqf/Rh8mXbnsUFecNIwVw9xyOigWs=; Message-ID: <165812.93846.qm@web114713.mail.gq1.yahoo.com> X-YMail-OSG: xoliuHcVM1lfCnmM2KCxptGJOWindxMOqITM339eiQ1TogZ UfOp8wO3xFgEvHo5HUq8FSkKO0YH7dBhMIUk5M_R1rkkk1MbV2rTJenbQIMy 66rD4V..c4A0TmHmgOH5TYpTuz2tMqufgOTwHClJhIhvkuNzdJ6cBBmJuIGh USyoWM.CROhuHZ1SkjjFDn58uYFU5upeSg8P_DhdL5Fjcws3plLiFykHKTOt OWYJyvoAD4IQ3zSqb66r3e15g1ySbb42U1pTOswHbx_SXygCtfU1WCEnLWnf ZCXB6rIdoeBvOZMb9qod6LPZuUsJOwbgJAOh6kaDAMCeGmfUFB2yqG7WGyfT ZqEBtP6WV2aLalkUoAgahefRKYcyDtPAvuUzs4UZe.5NttY7ZvOL0.Ph1MiY fyh1MkDYrnRFPzQ-- Received: from [92.86.139.196] by web114713.mail.gq1.yahoo.com via HTTP; Fri, 10 Jun 2011 06:11:31 PDT X-Mailer: YahooMailClassic/14.0.1 YahooMailWebService/0.8.111.304355 Date: Fri, 10 Jun 2011 06:11:31 -0700 (PDT) From: Paul Cazan Subject: Re: How to handle client disconnection in 'no timeout' async servlets? To: Tomcat Users List In-Reply-To: <402452.7384.qm@web114718.mail.gq1.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1244824504-1307711491=:93846" --0-1244824504-1307711491=:93846 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Is it possible that Tomcat 7.0.14 did not implement any sort of 'onDisconne= ctEvent' for asynchronous servlets 3.0? I am sure tomcat DOES KNOW when a client browser is closed, since the notif= ication arrives when using CometProcessor. Did anyone worked with asynchronous servlets as in Servlet 3.0 specificatio= n? --- On Thu, 9/6/11, Paul Cazan wrote: From: Paul Cazan Subject: How to handle client disconnection in 'no timeout' async servlets? To: users@tomcat.apache.org Date: Thursday, 9 June, 2011, 3:22 PM Hello, I am using Tomcat 7.0.14. I used to have a servlet implementing CometProces= sor to process asynchronous streams, with timeout set very high (Integer.MA= X_VALUE), and all worked fine. When I close the browser, the servlet is not= ified immediately about that (CometEvent.EventType.END) and I am happy to d= o the cleanup. No, I have created an async servlet 3.0, and all works as I expected, excep= t for notification when the browser is closed. I used request.startAsync(),= I added AsyncListener, and none of the events get fired when the browser i= s suddenly closed. Since I set the timeout to a large value (Long.MAX_VALUE= ), AsyncListener.onTimeout will never get called. As far as I understand, onComplete will get called only when I call AsyncCo= ntext.complete(), and I do not know when to call it. I tried to write on re= sponse.getWriter(), expecting to see an exception, but no exception was thr= own after a couple of writes. How can I handle this situation using servlet api 3.0, when the user closes= the browser or hits the stop button? I need to do the cleanup for that cli= ent.Meanwhile, I reverted the source code to CometProcessor. Thanks a lot,Paul --0-1244824504-1307711491=:93846--