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 1BD299F7B for ; Sun, 19 Aug 2012 19:22:33 +0000 (UTC) Received: (qmail 14847 invoked by uid 500); 19 Aug 2012 19:22:30 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 14660 invoked by uid 500); 19 Aug 2012 19:22:29 -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 14648 invoked by uid 99); 19 Aug 2012 19:22:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Aug 2012 19:22:29 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of pid@pidster.com designates 209.85.214.173 as permitted sender) Received: from [209.85.214.173] (HELO mail-ob0-f173.google.com) (209.85.214.173) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Aug 2012 19:22:22 +0000 Received: by obbta14 with SMTP id ta14so11102425obb.18 for ; Sun, 19 Aug 2012 12:22:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pidster.com; s=google; h=references:from:in-reply-to:mime-version:date:message-id:subject:to :content-type; bh=wcpkdtV4O9zqgaVAhDy7eY3UDtyxowSkMW5Jk5K9obg=; b=hwyk6i0cNKnuWFCiTiMs63aHrObiKV+FALLVhalxPGo4zsjxd9ebUdfK0cZiR/O7z+ 6c7m124CJR9kxYbxYbOQtG0/riWk8ZugE40s9c9OY4Diky+0F50Q/uxPZtaPomwh0826 a27heFAcfjcSgoJFWbgyP9ab4gVCVDMkj2hXc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=references:from:in-reply-to:mime-version:date:message-id:subject:to :content-type:x-gm-message-state; bh=wcpkdtV4O9zqgaVAhDy7eY3UDtyxowSkMW5Jk5K9obg=; b=R6oFEML3Ki+AfbVDHahL/VdMKdCg7nRumST4cuca9p5J96w30KPTAU46X04c6qy2c7 3HsvmaHcl0p2vj1veTBEJymm7uGNh+fYGmHdcQStxp3C5RqfEOCj+FutHhZsrEgnL0Q0 FccxdBchV27XHd+b8M/hmB0O7BNF2GCpPPlULrUsJrn/WE0xNkyb8B4wfZCunRfT3la7 z1qRaxgMaB2YswTf7AE/+J02JAkwB+URTD35iElFXVdNyUjZVPxEw9faTnCGc+1j8Njl JZgTa9u+H3kmhk57+xB2URhRQIGTaQeZK2cEV77zli6YPZ8R4I+8eBKsR6zi5qZAB4oF vYAw== Received: by 10.50.217.201 with SMTP id pa9mr7832896igc.54.1345404120925; Sun, 19 Aug 2012 12:22:00 -0700 (PDT) References: From: "Pid *" In-Reply-To: Mime-Version: 1.0 (1.0) Date: Sun, 19 Aug 2012 20:22:01 +0100 Message-ID: <4692606829321223130@unknownmsgid> Subject: Re: is this idea even possible in tomcat? To: Tomcat Users List Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQk+OkTCKjeq9UTDicWS516WGh7aQJHtYQtpoT2UrPkj8JjIEr4entZ66Npb2qF7uKayKvf0 On 11 Aug 2012, at 20:42, Elias Kopsiaftis wrote: > I posted about this a bit earlier, and I was told WebSockets were a better > approach, but I am wondering is what I am trying to do even possible? My > idea is to create a program that allows two users to connect through the > server, and send images and text to each other. for the server, i have two > servlets, one that uses comet, and one that does not. the regular servlet > listens for requests, and broadcasts them to all the available connections. > the comet servlet listens for connections, and once a connection is made, > stores the response in a singleton that both the regular servlet and comet > servlet have access to. the way its supposed to work is that the comet > servlet stores the response to all connected, the regular servlet listens > for messages, and once it receives one, gets a reference to the singleton, > goes through all its responses, and sends the message to each connection. i > can get my client to connect to the comet servlet just fine, via the tomcat > logs, but i cant get it to connect at all to the regular servlet and i dont > know why. when i print out the url used to connect to the regular servlet > and use the browser, i am not getting any server errors, so it looks like > it connects just fine, but none of my print statements in the inputservlet > ever get executed, meaning it never processes. now i am wondering, is this > idea even possible with the technology available in comet? None of the above sounds like a good idea. Use Comet/WebSockets and a message broker - the pattern you are looking for is called publish-subscribe. For open source brokers you can either use something like Apache ActiveMQ or RabbitMQ. p > > --bcaec550b36ca57b5304c702a778-- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org