Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 9069 invoked from network); 10 Aug 2009 13:32:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Aug 2009 13:32:00 -0000 Received: (qmail 71006 invoked by uid 500); 10 Aug 2009 13:32:03 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 70948 invoked by uid 500); 10 Aug 2009 13:32:03 -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 70937 invoked by uid 99); 10 Aug 2009 13:32:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Aug 2009 13:32:03 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [72.22.94.67] (HELO virtual.halosg.com) (72.22.94.67) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Aug 2009 13:31:51 +0000 Received: (qmail 5507 invoked from network); 10 Aug 2009 08:31:30 -0500 Received: from 38-171-19-72.skybeam.com (HELO ?192.168.1.42?) (72.19.171.38) by halosg.com with (DHE-RSA-AES256-SHA encrypted) SMTP; 10 Aug 2009 08:31:30 -0500 Message-ID: <4A802113.7040706@hanik.com> Date: Mon, 10 Aug 2009 07:30:59 -0600 From: Filip Hanik - Dev Lists User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Tomcat Comet and persistent connections References: <76E1EB1B0F306C42BAFADF64CA60112406895CFC@WISE.netcracker.com> <76E1EB1B0F306C42BAFADF64CA60112406895CFF@WISE.netcracker.com> In-Reply-To: <76E1EB1B0F306C42BAFADF64CA60112406895CFF@WISE.netcracker.com> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org after step 4 you should call close on the CometEvent. this way, tomcat should recycle all objects and be ready for a new request. you see, otherwise the next request would become a simple READ event (where the HTTP headers would become the body) in your case, the reason you're getting an error and the connection is closed, is cause the 2nd request, that tomcat thinks is the body exceeds the content length, and marks it as an error Filip On 08/10/2009 02:06 AM, Dmitry Murashenkov wrote: > Hello, > > we are developing a webapp and trying to use Tomcat Comet to allow asynchronous processing of requests. Somehow we have problems with persistent connections when using Comet (possibly due to some API misusage). > > So, the short question is: does Tomcat Comet servlets support persistent connections? > > Here is test case description: > > 1. Client opens connection to server and sends request. > 2. Servlet processes BEGIN and then several READ events, extracting all content. > 3. When all content is received (number of bytes received is equal to the value in Content-Length header) processing of request is passed to another ResponseSender thread (HttpServletRequest and HttpServletResponse objects from CometEvent are put into queue and ResponseSender thread iterates over this queue and sends responses). > 4. ResponseSender thread writes response and performs flushBuffer(). > 5. Client receives response. > 6. Client sends another request using the same connection. > 7. END event arrives to servlet and it must be closed (otherwise it will arrived again in the infinite loop). > 8. Closing END event results in closure of connection to server and second request is lost. > > It seems that each request in Comet must end with calling close() on the END event which will close connection to the client and will prevent client from submiting more than one request via this connection (using connection as a presistent). > > Is this behaviour expected? Is there a way to use persistent connections with async servlets based on Tomcat Comet architecture? > > Dmitry Murashenkov | Research& Development | +7 495 926 9347 ext 1689 | www.NetCracker.com>>>> Transforming the Service LayerTM > > > > The information transmitted herein is intended only for the person or entity to which it is addressed and may contain confidential, proprietary and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org