Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 31985 invoked from network); 3 Jun 2009 12:42:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Jun 2009 12:42:18 -0000 Received: (qmail 43380 invoked by uid 500); 3 Jun 2009 12:42:27 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 43329 invoked by uid 500); 3 Jun 2009 12:42:27 -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 43318 invoked by uid 99); 3 Jun 2009 12:42:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jun 2009 12:42:27 +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; Wed, 03 Jun 2009 12:42:15 +0000 Received: (qmail 1335 invoked from network); 3 Jun 2009 07:41:54 -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; 3 Jun 2009 07:41:54 -0500 Message-ID: <4A266F97.9040702@hanik.com> Date: Wed, 03 Jun 2009 06:41:59 -0600 From: Filip Hanik - Dev Lists User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: What is a typical Comet event flow, with multiple READ events? References: <2997c83e0906030332h3e00896au5201fcbd57e49347@mail.gmail.com> In-Reply-To: <2997c83e0906030332h3e00896au5201fcbd57e49347@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org When a browser is a client, you typically don't have multiple read events. Filip Pieter Fibbe wrote: > Hi, > > I have been trying to write a Comet webapp, but it's not totally clear > to me when and how CometEvents are exactly triggered. According to the > documentation a "typical life cycle of a Comet request will consist in > a series of events such as: BEGIN -> READ -> READ -> READ -> > ERROR/TIMEOUT" (from: http://www.mbaworld.com/docs/aio.html). > > It seems that a READ event is triggered only by a POST request, but > the "event flow" that I am getting never triggers more that one READ > event in a row, for example: BEGIN-> ->READ->END, BEGIN-> ->READ->END, > etc. Is the way a comet application should work? So you have to > establish a new connection every time you get a response from the > server and wait for the next response, process it and start from the > beginning? My idea was having one connection and reuse that connection > for multiple requests. So on the client side there would be something > like the following code: > > > > > > > Since it is not possible to invoke xhr.send() several times without > opening the connection first (xhr.open()), a CometEvent.BEGIN is > always triggered first. So how can the "BEGIN -> READ -> READ -> READ" > series (given in the documentation) be implemented? > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org