Return-Path: X-Original-To: apmail-mina-users-archive@www.apache.org Delivered-To: apmail-mina-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 6EF85F3D1 for ; Wed, 17 Apr 2013 16:48:57 +0000 (UTC) Received: (qmail 49390 invoked by uid 500); 17 Apr 2013 16:48:57 -0000 Delivered-To: apmail-mina-users-archive@mina.apache.org Received: (qmail 49360 invoked by uid 500); 17 Apr 2013 16:48:57 -0000 Mailing-List: contact users-help@mina.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@mina.apache.org Delivered-To: mailing list users@mina.apache.org Received: (qmail 49351 invoked by uid 99); 17 Apr 2013 16:48:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Apr 2013 16:48:57 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [80.67.31.104] (HELO smtprelay06.ispgateway.de) (80.67.31.104) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Apr 2013 16:48:51 +0000 Received: from [77.0.2.105] (helo=[192.168.178.24]) by smtprelay06.ispgateway.de with esmtps (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1USVWj-00038L-Sj for users@mina.apache.org; Wed, 17 Apr 2013 18:48:09 +0200 Subject: Re: XML Protocol with initial ASCII handshake References: <516EBD02.3000701@facilityboss.biz> <516EC51B.2080107@gmail.com> From: Max Larsson Content-Type: text/plain; charset=utf-8 X-Mailer: iPad Mail (10B329) In-Reply-To: <516EC51B.2080107@gmail.com> Message-Id: <603436D2-0BA3-4A0F-AE98-96BC771AF4B4@facilityboss.biz> Date: Wed, 17 Apr 2013 18:48:10 +0200 To: "users@mina.apache.org" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) X-Df-Sender: [pbs]NzQ1MzY5 X-Virus-Checked: Checked by ClamAV on apache.org Hi, The XML size is send in the front of the actual data.=20 Regrads Max Am 17.04.2013 um 17:51 schrieb Emmanuel L=C3=A9charny := > Le 4/17/13 5:17 PM, Max Larsson a =C3=A9crit : >> Hi, > Hi, >>=20 >> I'm using MINA to develop a client for a mainly XML based protocol. > Not the simplest kind of protocol to decode ... >=20 >>=20 >> And i have some problems to figure out how to realize it in the best >> way. The cause of the problem is that the Protocol has upon >> a successful connection to the IP/Port a initial procedure to select >> the desired protocol and version is performed, before the actual XML >> Protocol starts. >>=20 >> Up on now i created a StateMachine (similar to the TapeDeck Example on >> the website) which models the initial procedure. That seems to work. >> What i now wanted to do is, when this StateMachine has reached it >> connect state (and the actually XML protocol starts), to forward >> all message to another StateMaschine which works upon the first one. >> Alternative i thought about to implement a custom IOConnector, >> which uses the first StateMachine to establish a connection. > There is a big problem with this approach : you won't know when the XML > data will be fully received before having parsed it... >=20 > Unless your encapsulating protocol gives you the size of the XML data ! >=20 > Is it the case ? >=20 >=20 > --=20 > Regards, > Cordialement, > Emmanuel L=C3=A9charny > www.iktek.com=20 >=20