Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 21819 invoked from network); 23 May 2006 23:12:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 May 2006 23:12:59 -0000 Received: (qmail 2612 invoked by uid 500); 23 May 2006 23:12:54 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 2557 invoked by uid 500); 23 May 2006 23:12:53 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 2545 invoked by uid 99); 23 May 2006 23:12:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 May 2006 16:12:53 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [63.210.102.130] (HELO cprobd02.vailsys.com) (63.210.102.130) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 May 2006 16:12:52 -0700 Received: from dfsfbd06.vail (dfsfbd06.vail [192.168.129.190]) by cprobd02.vailsys.com (Postfix) with ESMTP id A36A1CE4E5 for ; Tue, 23 May 2006 18:12:31 -0500 (CDT) Received: from [192.168.129.15] (ltwddurham.vail [192.168.129.15]) by dfsfbd06.vail (Postfix) with ESMTP id 764EC323FAF for ; Tue, 23 May 2006 18:12:31 -0500 (CDT) Message-ID: <447396E0.3000208@vailsys.com> Date: Tue, 23 May 2006 18:12:32 -0500 From: David Durham User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: commons-user@jakarta.apache.org Subject: [digester] multiple parses from one inputstream Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi all, I'd like to use Digester to parse multiple XML messsages being passed from a server to a client. The parse method hangs until I close the server output stream. Anyway to signal to Digester.parse(InputStream) that it should return without having reached the end of an inputstream? Or do I have chose a different parse method? Basically, I'd like to do something like this in the client: .. socket = new Socket("localhost", port); out = new PrintWriter(socket.getOutputStream(), true); in = new BufferedReader(new InputStreamReader(socket.getInputStream()); String inputLine = null; while ((inputLine = stdIn.readLine()) != null) { System.out.println("From user: " + inputLine); if (inputLine.equals("Bye.")) { out.println("Bye."); break; } Digester digester = new Digester(); digester.setValidating( false ); digester.addObjectCreate( "test", DigesterTest.class ); digester.addBeanPropertySetter("test/property", "property"); DigesterTest test = null; try { test = (DigesterTest)digester.parse(in); } catch (IOException e) { e.printStackTrace(System.out); } catch (SAXException e) { e.printStackTrace(System.out); } System.out.println(test.getProperty()); out.println("ready"); } out.close(); in.close(); stdIn.close(); socket.close(); Again, the client hangs on digester.parse until server closes output stream. Thanks, Dave --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org