Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 63519 invoked from network); 3 Apr 2006 13:31:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Apr 2006 13:31:05 -0000 Received: (qmail 46720 invoked by uid 500); 3 Apr 2006 13:30:52 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 46703 invoked by uid 500); 3 Apr 2006 13:30:52 -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 46692 invoked by uid 99); 3 Apr 2006 13:30:52 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2006 06:30:52 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [213.239.213.83] (HELO www.drive2day.de) (213.239.213.83) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2006 06:30:51 -0700 Received: from localhost (localhost [127.0.0.1]) by www.drive2day.de (Postfix) with ESMTP id 3140D734036 for ; Mon, 3 Apr 2006 15:13:42 +0200 (CEST) Received: from www.drive2day.de ([127.0.0.1]) by localhost (www.drive2day.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08304-02 for ; Mon, 3 Apr 2006 15:13:41 +0200 (CEST) Received: from [192.168.1.2] (debian [213.239.213.83]) by www.drive2day.de (Postfix) with ESMTP id 4AD1A734033 for ; Mon, 3 Apr 2006 15:13:41 +0200 (CEST) Message-ID: <4431231B.7010805@weboperations.com> Date: Mon, 03 Apr 2006 16:28:59 +0300 From: Tp User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Rephrased: Maximum number of simultaneous HTTP connections References: <4430F86B.2080503@weboperations.com> <44314702.60501@gmail.com> <6d959d480604030403w3ecf9720xd7fb469ff1d8d11c@mail.gmail.com> <443104D6.9070206@weboperations.com> <6d959d480604030441o6597f85cn556dfb6ab1bea086@mail.gmail.com> <44311B5D.2090503@weboperations.com> <6d959d480604030621u618673eawc99c73ec11000e11@mail.gmail.com> In-Reply-To: <6d959d480604030621u618673eawc99c73ec11000e11@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at drive2day.de X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Remy Maucherat schrieb: > On 4/3/06, Tp wrote: > >>Well, I don't know what you understand under polling. I guess you mean >>the clients will have to sent GET and POST requests repeately, right? >> >>The load is going to be even higher with polling. That's I would not >>introduce any polling. How would I do this anyway, if I only use HTML? >> >>My idea was opening a connection and then just let the client wait and >>sit there. Whenever I get new messages, then I will sent them over. >> >>Here a diagram: >> >>Client sends GET -> Server >>Server sends HEADERS (Content Encoding: Chunked) -> Client >>Server sends chunks -> Client >>Client displays them whenever they arrive. > > > Of course. It's the problem I was describing. The only way to do it > using the Servlet model is to keep the service method running forever, > since the Servlet API doesn't allow the server to write data > asynchronously in response to certain events. > > It is actually the SIP Servlets model (which is why I mentioned it earlier). > > >>Well actually you caught me here. You are right. I mean I have tested it >>and after the doGet() and doPost() methods returned the connection was >>closed. But you are absolutely right, that this can't be a general >>policy and indeed depends on the keepalive timeout. So I have to check >>this out, it could actually be the solutions for my problem at least >>when it comes to saving the threads for each conneciton. >> >>I could just remember the HttpRespone Objects and use one thread, which >>gets, when new messages arrive in the queue. The thread then could >>println() them to all he HttpRespones. This would save me all the >>Threads. Hmm, sounds good, or have I missed somthing?! > > > At this point, this has nothing to do with a Servlet. I know it won't > work in Tomcat. > > But you said that the connection will not close, when the doGet() or doPost() method returns, which of course make a lot of sense. Otherwise Persistent connections would not be possible at all. So if that's true, then I should be able to write to the OutputStream of the HttpResponse at a time, when the doGet() and doPost() method has returned. Why would it not work? >>>Yes, but you need the 5000 or so threads to do this, and there's no >>>workaround. So it is the real problem since it forces you to use >>>polling. >>> >> >>What do you mean with polling? I mean none of the threads is polling >>using this method, or? For example 5000 Threads would be waiting. Then a >>message arrives and all of them get notified and then they sent the >>message to the clients. So I don't see where polling comes in?! > > > Right. I said you need to use polling, or use 5000 threads (which is > not a problem if you have enough memory). > > -- > xxxxxxxxxxxxxxxxxxxxxxxxx > R�my Maucherat > Developer & Consultant > JBoss Inc > xxxxxxxxxxxxxxxxxxxxxxxxx > > --------------------------------------------------------------------- > 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